public ContentResult Get()
        {
            var wsFederationMessage = ValidateRequestType();
            ValidateWsFederationMessage(wsFederationMessage);

            var samlTokenService = new SamlTokenService(
                new RealmTracker(HttpContext),
                new SecurityTokenServiceConfigurationFactory());
            var signInResponseMessage = samlTokenService.CreateResponseContainingToken(HttpContext.Request.Url);

            return new ContentResult { Content = signInResponseMessage.WriteFormPost() };
        }
Example #2
0
        public ContentResult Token()
        {
            var wsFederationMessage = ValidateRequestType();

            ValidateWsFederationMessage(wsFederationMessage);

            var samlTokenService = new SamlTokenService(
                new RealmTracker(HttpContext),
                new SecurityTokenServiceConfigurationFactory());
            var signInResponseMessage = samlTokenService.CreateResponseContainingToken(HttpContext.Request.Url);

            return(new ContentResult {
                Content = signInResponseMessage.WriteFormPost()
            });
        }