示例#1
0
 public static Status BuildStatus(string code, string message = null)
 {
     return(new Status
     {
         StatusMessage = message,
         StatusCode = ResponseFactoryMock.GetStatusCode(code, null)
     });
 }
示例#2
0
        public static TokenResponse GetTokenResponseSuccess(string inResponseTo)
        {
            var response         = ResponseFactoryMock.GetTokenResponse(inResponseTo, StatusCodes.Success);
            var assertion        = AssertionFactroryMock.BuildAssertion();
            var token            = AssertionFactroryMock.GetToken(assertion);
            var assertionElement = AssertionFactroryMock.SerialiseToken(token);

            response.Assertions = new XmlElement[] { assertionElement };
            return(response);
        }
示例#3
0
        public static LogoutResponse GetLogoutResponse(string inResponseTo, string statusCode)
        {
            var response = new LogoutResponse
            {
                ID           = "Test_" + Guid.NewGuid().ToString(),
                Destination  = "http://localhost:59611/",
                IssueInstant = DateTime.UtcNow,
                InResponseTo = inResponseTo,
                Status       = ResponseFactoryMock.BuildStatus(statusCode, null),
                Issuer       = new NameId {
                    Value = "https://dg-mfb/idp/shibboleth", Format = NameIdentifierFormats.Entity
                }
            };

            return(response);
        }