Пример #1
0
        public CloudFoundryOAuthOptions()
        {
            ClaimsIssuer = CloudFoundryDefaults.AuthenticationScheme;
            ClientId     = CloudFoundryDefaults.ClientId;
            ClientSecret = CloudFoundryDefaults.ClientSecret;
            CallbackPath = new PathString(CloudFoundryDefaults.CallbackPath);
            SaveTokens   = true;

            ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "user_id");
            ClaimActions.MapJsonKey(ClaimTypes.Name, "user_name");
            ClaimActions.MapJsonKey(ClaimTypes.GivenName, "given_name");
            ClaimActions.MapJsonKey(ClaimTypes.Surname, "family_name");
            ClaimActions.MapJsonKey(ClaimTypes.Email, "email");
            ClaimActions.MapScopes();

            SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;

            SetEndpoints("http://" + CloudFoundryDefaults.OAuthServiceUrl);
        }
Пример #2
0
        public CloudFoundryOAuthOptions()
        {
            string authURL = "http://" + CloudFoundryDefaults.OAuthServiceUrl;

            ClaimsIssuer            = CloudFoundryDefaults.AuthenticationScheme;
            ClientId                = CloudFoundryDefaults.ClientId;
            ClientSecret            = CloudFoundryDefaults.ClientSecret;
            CallbackPath            = new PathString(CloudFoundryDefaults.CallbackPath);
            AuthorizationEndpoint   = authURL + CloudFoundryDefaults.AuthorizationUri;
            TokenEndpoint           = authURL + CloudFoundryDefaults.AccessTokenUri;
            UserInformationEndpoint = authURL + CloudFoundryDefaults.UserInfoUri;
            TokenInfoUrl            = authURL + CloudFoundryDefaults.CheckTokenUri;
            SaveTokens              = true;

            ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "user_id");
            ClaimActions.MapJsonKey(ClaimTypes.Name, "user_name");
            ClaimActions.MapJsonKey(ClaimTypes.GivenName, "given_name");
            ClaimActions.MapJsonKey(ClaimTypes.Surname, "family_name");
            ClaimActions.MapJsonKey(ClaimTypes.Email, "email");
            ClaimActions.MapScopes();

            SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
        }