示例#1
0
        internal void UpdateOptions(OAuthConnectorOptions config, OAuthServiceOptions options)
        {
            if (config == null)
            {
                return;
            }

            options.ClientId             = config.ClientId;
            options.ClientSecret         = config.ClientSecret;
            options.AccessTokenUrl       = config.OAuthServiceUrl + config.AccessTokenUri;
            options.UserAuthorizationUrl = config.OAuthServiceUrl + config.UserAuthorizationUri;
            options.TokenInfoUrl         = config.OAuthServiceUrl + config.TokenInfoUri;
            options.UserInfoUrl          = config.OAuthServiceUrl + config.UserInfoUri;
            options.JwtKeyUrl            = config.OAuthServiceUrl + config.JwtKeyUri;
            options.ValidateCertificates = config.ValidateCertificates;
            if (config.Scope != null)
            {
                foreach (var scope in config.Scope)
                {
                    options.Scope.Add(scope);
                }
            }

            return;
        }
示例#2
0
        internal IOptions <OAuthServiceOptions> Configure(SsoServiceInfo si, OAuthConnectorOptions configuration)
        {
            OAuthServiceOptions ssoOptions = new OAuthServiceOptions();

            UpdateOptions(configuration, ssoOptions);
            UpdateOptions(si, ssoOptions);
            return(new ConnectorIOptions <OAuthServiceOptions>(ssoOptions));
        }
示例#3
0
        internal void UpdateOptions(SsoServiceInfo si, OAuthServiceOptions options)
        {
            if (si == null)
            {
                return;
            }

            options.ClientId             = si.ClientId;
            options.ClientSecret         = si.ClientSecret;
            options.AccessTokenUrl       = si.AuthDomain + OAuthConnectorDefaults.Default_AccessTokenUri;
            options.UserAuthorizationUrl = si.AuthDomain + OAuthConnectorDefaults.Default_AuthorizationUri;
            options.TokenInfoUrl         = si.AuthDomain + OAuthConnectorDefaults.Default_CheckTokenUri;
            options.UserInfoUrl          = si.AuthDomain + OAuthConnectorDefaults.Default_UserInfoUri;
            options.JwtKeyUrl            = si.AuthDomain + OAuthConnectorDefaults.Default_JwtTokenKey;
        }