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

            response.Assertions = new XmlElement[] { assertionElement };
            return(response);
        }
Beispiel #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);
        }