Class OAuth2Scope
java.lang.Object
cloud.opencode.base.oauth2.OAuth2Scope
OAuth2 Scope
OAuth2 权限范围
Represents OAuth2 scopes for authorization requests.
表示授权请求的 OAuth2 权限范围。
Features | 主要功能:
- Predefined standard scopes - 预定义标准范围
- Provider-specific scopes - 特定提供者范围
- Scope combination utilities - 范围组合工具
Usage Examples | 使用示例:
// Use predefined scopes
Set<String> scopes = OAuth2Scope.combine(
OAuth2Scope.OPENID,
OAuth2Scope.EMAIL,
OAuth2Scope.PROFILE
);
// Google Gmail scope
String gmailScope = OAuth2Scope.Google.GMAIL_READONLY;
// Microsoft Graph scope
String graphScope = OAuth2Scope.Microsoft.USER_READ;
Thread Safety | 线程安全:
This class is immutable and thread-safe.
此类是不可变的,线程安全。
- Since:
- JDK 25, opencode-base-oauth2 V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classGitHub-specific scopes GitHub 特定范围static final classGoogle-specific scopes Google 特定范围static final classMicrosoft-specific scopes Microsoft 特定范围 -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringAddress scope - access to address claim Address 范围 - 访问地址声明static final StringEmail scope - access to email and email_verified claims Email 范围 - 访问电子邮件和电子邮件验证声明static final StringOffline access scope - request refresh token Offline access 范围 - 请求刷新令牌static final StringOpenID scope - required for OIDC OpenID 范围 - OIDC 必需static final StringPhone scope - access to phone_number and phone_number_verified claims Phone 范围 - 访问电话号码和电话号码验证声明static final StringProfile scope - access to user profile claims Profile 范围 - 访问用户资料声明 -
Method Summary
Modifier and TypeMethodDescriptionCombine multiple scopes into a set 将多个范围组合成一个集合Combine scope sets 组合范围集合Get default OIDC scopes 获取默认 OIDC 范围Parse space-separated scope string to set 将空格分隔的范围字符串解析为集合static StringConvert scopes to space-separated string 将范围转换为空格分隔的字符串static StringConvert scopes to space-separated string 将范围转换为空格分隔的字符串
-
Field Details
-
OPENID
-
PROFILE
Profile scope - access to user profile claims Profile 范围 - 访问用户资料声明- See Also:
-
EMAIL
Email scope - access to email and email_verified claims Email 范围 - 访问电子邮件和电子邮件验证声明- See Also:
-
ADDRESS
Address scope - access to address claim Address 范围 - 访问地址声明- See Also:
-
PHONE
Phone scope - access to phone_number and phone_number_verified claims Phone 范围 - 访问电话号码和电话号码验证声明- See Also:
-
OFFLINE_ACCESS
Offline access scope - request refresh token Offline access 范围 - 请求刷新令牌- See Also:
-
-
Method Details
-
combine
-
combine
Combine scope sets 组合范围集合- Parameters:
scopeSets- the scope sets to combine | 要组合的范围集合- Returns:
- the combined scope set | 组合的范围集合
-
toString
-
toString
-
parse
-
defaultOidc
-