Skip to content

class IdentityServerBuilder

cangjie
public class IdentityServerBuilder

功能:提供 Identity Server 服务注册构建能力。

成员概览

成员功能
let services保存当前构建器关联的服务集合。

let services

cangjie
public let services: ServiceCollection

功能:保存当前构建器关联的服务集合。

类型:ServiceCollection

扩展成员

成员功能
func addInMemoryClients(IConfiguration)从配置中添加内存客户端存储。
func addInMemoryIdentityResources(IConfiguration)从配置中添加内存身份资源存储。
func addInMemoryApiScopes(IConfiguration)从配置中添加内存 API 作用域存储。
func addInMemoryApiResources(IConfiguration)从配置中添加内存 API 资源存储。
func addEndpoint(String, String)注册一个 Identity Server 端点处理器。
func addDefaultEndpoints()注册默认 Identity Server 端点。
func addRequiredServices()注册 Identity Server 必需服务。
func addPluggableServices()注册可替换的 Identity Server 默认服务。
func addResponseGenerators()注册响应生成器服务。
func addValidators()注册默认验证器服务。
func addInMemorySigningCredentials(Collection<SigningCredentials>)使用内存中的签名凭据集合注册签名凭据存储。
func addSigningCredentialStore()注册签名凭据存储实现类型。
func addInMemoryClients(Collection<Client>)使用内存中的客户端集合注册客户端存储。
func addClientStore()注册客户端存储实现类型。
func addInMemoryApiScopes(Collection<ApiScope>)使用内存中的 API 作用域集合注册作用域存储。
func addApiScopeStore()注册 API 作用域存储实现类型。
func addInMemoryApiResources(Collection<ApiResource>)使用内存中的 API 资源集合注册资源存储。
func addApiResourceStore()注册 API 资源存储实现类型。
func addInMemoryIdentityResources(Collection<IdentityResource>)使用内存中的身份资源集合注册身份资源存储。
func addIdentityResourceStore()注册身份资源存储实现类型。
func addInMemoryConsentStore()注册基于内存的同意存储。
func addConsentStore()注册同意存储实现类型。
func addInMemoryRefreshTokenStore()注册基于内存的刷新令牌存储。
func addRefreshTokenStore()注册刷新令牌存储实现类型。
func addInMemoryAuthorizationCodeStore()注册基于内存的授权码存储。
func addAuthorizationCodeStore()注册授权码存储实现类型。
func addExtensionGrantValidator(String)注册扩展授权验证器。
func addPasswordGrantValidator()注册密码授权验证器。
func addProfileService()注册用户资料服务实现。

func addInMemoryClients(IConfiguration)

cangjie
public func addInMemoryClients(configuration: IConfiguration): IdentityServerBuilder

功能:从配置中添加内存客户端存储。

参数:

  • configuration: IConfiguration - 配置实例,通常为构建器配置对象或其子节。

返回值:

func addInMemoryIdentityResources(IConfiguration)

cangjie
public func addInMemoryIdentityResources(configuration: IConfiguration): IdentityServerBuilder

功能:从配置中添加内存身份资源存储。

参数:

  • configuration: IConfiguration - 配置实例,通常为构建器配置对象或其子节。

返回值:

func addInMemoryApiScopes(IConfiguration)

cangjie
public func addInMemoryApiScopes(configuration: IConfiguration): IdentityServerBuilder

功能:从配置中添加内存 API 作用域存储。

参数:

  • configuration: IConfiguration - 配置实例,通常为构建器配置对象或其子节。

返回值:

func addInMemoryApiResources(IConfiguration)

cangjie
public func addInMemoryApiResources(configuration: IConfiguration): IdentityServerBuilder

功能:从配置中添加内存 API 资源存储。

参数:

  • configuration: IConfiguration - 配置实例,通常为构建器配置对象或其子节。

返回值:

func addEndpoint(String, String)

cangjie
public func addEndpoint<TEndpointHandler>(name: String, path: String): IdentityServerBuilder where TEndpointHandler <: IEndpointHandler

功能:注册一个 Identity Server 端点处理器。

参数:

  • name: String - 端点名称。
  • path: String - 端点路径。

返回值:

func addDefaultEndpoints()

cangjie
public func addDefaultEndpoints(): IdentityServerBuilder

功能:注册默认 Identity Server 端点。

返回值:

func addRequiredServices()

cangjie
public func addRequiredServices(): IdentityServerBuilder

功能:注册 Identity Server 必需服务。

返回值:

func addPluggableServices()

cangjie
public func addPluggableServices(): IdentityServerBuilder

功能:注册可替换的 Identity Server 默认服务。

返回值:

func addResponseGenerators()

cangjie
public func addResponseGenerators(): IdentityServerBuilder

功能:注册响应生成器服务。

返回值:

func addValidators()

cangjie
public func addValidators(): IdentityServerBuilder

功能:注册默认验证器服务。

返回值:

func addInMemorySigningCredentials(Collection<SigningCredentials>)

cangjie
public func addInMemorySigningCredentials(credential: Collection<SigningCredentials>): IdentityServerBuilder

功能:使用内存中的签名凭据集合注册签名凭据存储。

参数:

返回值:

func addSigningCredentialStore()

cangjie
public func addSigningCredentialStore<TSigningCredentialStore>(): IdentityServerBuilder where TSigningCredentialStore <: Object

功能:注册签名凭据存储实现类型。

返回值:

func addInMemoryClients(Collection<Client>)

cangjie
public func addInMemoryClients(clients: Collection<Client>): IdentityServerBuilder

功能:使用内存中的客户端集合注册客户端存储。

参数:

  • clients: Collection<Client> - 客户端集合。

返回值:

func addClientStore()

cangjie
public func addClientStore<TClientStore>(): IdentityServerBuilder where TClientStore <: Object

功能:注册客户端存储实现类型。

返回值:

func addInMemoryApiScopes(Collection<ApiScope>)

cangjie
public func addInMemoryApiScopes(apiScopes: Collection<ApiScope>): IdentityServerBuilder

功能:使用内存中的 API 作用域集合注册作用域存储。

参数:

  • apiScopes: Collection<ApiScope> - API 作用域集合。

返回值:

func addApiScopeStore()

cangjie
public func addApiScopeStore<TApiScopeStore>(): IdentityServerBuilder where TApiScopeStore <: Object

功能:注册 API 作用域存储实现类型。

返回值:

func addInMemoryApiResources(Collection<ApiResource>)

cangjie
public func addInMemoryApiResources(apiResources: Collection<ApiResource>): IdentityServerBuilder

功能:使用内存中的 API 资源集合注册资源存储。

参数:

  • apiResources: Collection<ApiResource> - API 资源集合。

返回值:

func addApiResourceStore()

cangjie
public func addApiResourceStore<TApiResourceStore>(): IdentityServerBuilder where TApiResourceStore <: Object

功能:注册 API 资源存储实现类型。

返回值:

func addInMemoryIdentityResources(Collection<IdentityResource>)

cangjie
public func addInMemoryIdentityResources(identityResources: Collection<IdentityResource>): IdentityServerBuilder

功能:使用内存中的身份资源集合注册身份资源存储。

参数:

返回值:

func addIdentityResourceStore()

cangjie
public func addIdentityResourceStore<TIdentityResourceStore>(): IdentityServerBuilder where TIdentityResourceStore <: Object

功能:注册身份资源存储实现类型。

返回值:

func addInMemoryConsentStore()

cangjie
public func addInMemoryConsentStore(): IdentityServerBuilder

功能:注册基于内存的同意存储。

返回值:

func addConsentStore()

cangjie
public func addConsentStore<TConsentStore>(): IdentityServerBuilder where TConsentStore <: Object

功能:注册同意存储实现类型。

返回值:

func addInMemoryRefreshTokenStore()

cangjie
public func addInMemoryRefreshTokenStore(): IdentityServerBuilder

功能:注册基于内存的刷新令牌存储。

返回值:

func addRefreshTokenStore()

cangjie
public func addRefreshTokenStore<TRefreshTokenStore>(): IdentityServerBuilder where TRefreshTokenStore <: Object

功能:注册刷新令牌存储实现类型。

返回值:

func addInMemoryAuthorizationCodeStore()

cangjie
public func addInMemoryAuthorizationCodeStore(): IdentityServerBuilder

功能:注册基于内存的授权码存储。

返回值:

func addAuthorizationCodeStore()

cangjie
public func addAuthorizationCodeStore<TAuthorizationCodeStore>(): IdentityServerBuilder where TAuthorizationCodeStore <: Object

功能:注册授权码存储实现类型。

返回值:

func addExtensionGrantValidator(String)

cangjie
public func addExtensionGrantValidator<TExtensionGrantValidator>(grantType: String): IdentityServerBuilder where TExtensionGrantValidator <: Object

功能:注册扩展授权验证器。

参数:

  • grantType: String - 扩展授权类型名称。

返回值:

func addPasswordGrantValidator()

cangjie
public func addPasswordGrantValidator<TValidator>(): IdentityServerBuilder where TValidator <: Object

功能:注册密码授权验证器。

返回值:

func addProfileService()

cangjie
public func addProfileService<TProfileService>(): IdentityServerBuilder where TProfileService <: Object

功能:注册用户资料服务实现。

返回值: