Esempio n. 1
0
        public IActionResult GetV2Admin()
        {
            var adminConsentGrant = new TokenTool.Microsoft.v2.AdminConsentGrant(config["v2Endpoint:clientId"], "http://localhost:64191/auth/admin");
            var result            = adminConsentGrant.ProcessAuthorizationResponse(this.Request.QueryString.ToString());

            return(new JsonResult(result, new JsonSerializerSettings()
            {
                Formatting = Formatting.Indented, NullValueHandling = NullValueHandling.Ignore
            }));
        }
Esempio n. 2
0
        private void Setupv2()
        {
            var adminConsentGrant = new TokenTool.Microsoft.v2.AdminConsentGrant(config["v2Endpoint:clientId"], "http://localhost:64191/auth/admin");

            V2AdminUri = adminConsentGrant.AuthorizationUri;

            var authorizationCodeGrant = new TokenTool.Microsoft.v2.AuthorizationCodeGrant()
            {
                ClientId    = config["v2Endpoint:clientId"],
                Scope       = config["v2Endpoint:scopes"],
                RedirectUri = "http://localhost:64191/auth/authcode",
                Prompt      = "consent"
            };

            V2AuthUri = authorizationCodeGrant.AuthorizationUri;

            var implicitGrant = new TokenTool.Microsoft.v2.ImplicitGrant()
            {
                ClientId    = config["v2Endpoint:clientId"],
                RedirectUri = "http://localhost:64191/",
                Scope       = "user.read",
                Prompt      = "consent"
            };

            V2ImplicitUri = implicitGrant.AuthorizationUri;

            var openIdImplicitGrant = new TokenTool.Microsoft.v2.ImplicitGrant()
            {
                ClientId     = config["v2Endpoint:clientId"],
                RedirectUri  = "http://localhost:64191/auth/implicit",
                ResponseType = "id_token+token",
                Scope        = "openid email profile user.read",
                Prompt       = "consent"
            };

            V2OpenIdUri = openIdImplicitGrant.AuthorizationUri;
        }