Class OAuth2Client.Builder

java.lang.Object
cloud.opencode.base.oauth2.OAuth2Client.Builder
Enclosing class:
OAuth2Client

public static class OAuth2Client.Builder extends Object
OAuth2Client Builder OAuth2Client 构建器
Since:
JDK 25, opencode-base-oauth2 V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • config

      public OAuth2Client.Builder config(OAuth2Config config)
      Set the configuration 设置配置
      Parameters:
      config - the configuration | 配置
      Returns:
      this builder | 此构建器
    • provider

      public OAuth2Client.Builder provider(OAuth2Provider provider)
      Set the provider 设置提供者
      Parameters:
      provider - the provider | 提供者
      Returns:
      this builder | 此构建器
    • clientId

      public OAuth2Client.Builder clientId(String clientId)
      Set the client ID 设置客户端 ID
      Parameters:
      clientId - the client ID | 客户端 ID
      Returns:
      this builder | 此构建器
    • clientSecret

      public OAuth2Client.Builder clientSecret(String clientSecret)
      Set the client secret 设置客户端密钥
      Parameters:
      clientSecret - the client secret | 客户端密钥
      Returns:
      this builder | 此构建器
    • redirectUri

      public OAuth2Client.Builder redirectUri(String redirectUri)
      Set the redirect URI 设置重定向 URI
      Parameters:
      redirectUri - the redirect URI | 重定向 URI
      Returns:
      this builder | 此构建器
    • scopes

      public OAuth2Client.Builder scopes(String... scopes)
      Add scopes 添加权限范围
      Parameters:
      scopes - the scopes | 权限范围
      Returns:
      this builder | 此构建器
    • grantType

      public OAuth2Client.Builder grantType(GrantType grantType)
      Set the grant type 设置授权类型
      Parameters:
      grantType - the grant type | 授权类型
      Returns:
      this builder | 此构建器
    • tokenStore

      public OAuth2Client.Builder tokenStore(TokenStore tokenStore)
      Set the token store 设置 Token 存储
      Parameters:
      tokenStore - the token store | Token 存储
      Returns:
      this builder | 此构建器
    • httpClient

      public OAuth2Client.Builder httpClient(OAuth2HttpClient httpClient)
      Set the HTTP client 设置 HTTP 客户端
      Parameters:
      httpClient - the HTTP client | HTTP 客户端
      Returns:
      this builder | 此构建器
    • build

      public OAuth2Client build()
      Build the OAuth2Client 构建 OAuth2Client
      Returns:
      the client | 客户端