public IHttpActionResult GetMetadata()
        {
            var ep     = Request.GetBaseUrl(_settings.GetPublicHost()) + "wsfed";
            var entity = _metadataResponseGenerator.Generate(ep);

            return(new MetadataResult(entity));
        }
示例#2
0
        public async Task <dynamic> GetConfiguration()
        {
            var baseUrl = Request.GetBaseUrl(_settings.GetPublicHost());
            var scopes  = await _scopes.GetScopesAsync();

            return(new
            {
                issuer = _settings.GetIssuerUri(),
                jwks_uri = baseUrl + ".well-known/jwks",
                authorization_endpoint = baseUrl + "connect/authorize",
                token_endpoint = baseUrl + "connect/token",
                userinfo_endpoint = baseUrl + "connect/userinfo",
                end_session_endpoint = baseUrl + "connect/logout",
                scopes_supported = scopes.Select(s => s.Name),
                response_types_supported = Constants.SupportedResponseTypes,
                response_modes_supported = Constants.SupportedResponseModes,
                grant_types_supported = Constants.SupportedGrantTypes,
                subject_types_support = new string[] { "pairwise", "public" },
                id_token_signing_alg_values_supported = "RS256"
            });
        }
示例#3
0
        public IHttpActionResult Logout()
        {
            logger.Start("[AuthenticationController.Logout] called");

            var ctx = Request.GetOwinContext();

            ctx.Authentication.SignOut(
                Constants.PrimaryAuthenticationType,
                Constants.ExternalAuthenticationType,
                Constants.PartialSignInAuthenticationType);

            ClearLoginRequestMessage();

            var baseUrl = Request.GetBaseUrl(settings.GetPublicHost());
            var urls    = new List <string>();

            foreach (var url in this.internalConfiguration.PluginDependencies.SignOutCallbackUrls)
            {
                var tmp = url;
                if (tmp.StartsWith("/"))
                {
                    tmp = tmp.Substring(1);
                }
                urls.Add(baseUrl + tmp);
            }

            return(new EmbeddedHtmlResult(Request,
                                          new LayoutModel
            {
                Server = settings.GetSiteName(),
                Page = "logout",
                PageModel = new
                {
                    signOutUrls = urls.ToArray()
                }
            }));
        }