Documentation
¶
Index ¶
- Constants
- func ConvertKeyToPEM(nStr, eStr string) ([]byte, error)
- func ExtractKidFromIDToken(idToken string) string
- func GetOAuthURLIdentifierKey(state string) string
- func VerifyIDToken(idToken string, publicKeyPEM []byte) (map[string]interface{}, error)
- type GetPublicKeyResp
- type OAuth
- func (oauth *OAuth) BuildAuthPageURL() (string, error)
- func (oauth *OAuth) HandleOAuth2ByAPPAuthToken(token string) (*plugin.OAuthUser, error)
- func (oauth *OAuth) HandleOAuth2ByAuthCode(code *plugin.VerifyCode) (*plugin.OAuthUser, error)
- func (oauth *OAuth) HandlerAuth(code string) (*plugin.OAuthUser, error)
- func (oauth *OAuth) Provide(ctx context.Context) any
- type Option
- type Options
Constants ¶
View Source
const ( // BuildOAuthPageURL Apple OAuth2 构建授权页面 URL 的请求地址 BuildOAuthPageURL = "https://appleid.apple.com/auth/authorize" // EndpointPublicKeyURL Apple OAuth2 获取公钥的请求地址 EndpointPublicKeyURL = "https://appleid.apple.com/auth/keys" )
View Source
const (
// OAuthUrlIdentifierKey 构建生成的授权 URL 标识键,用于验证授权来源
OAuthUrlIdentifierKey = "apple.oauth2.url.identifier.%s"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertKeyToPEM ¶ added in v0.5.17
ConvertKeyToPEM 将 Apple 公钥的 n 和 e 转换为 PEM 格式
func ExtractKidFromIDToken ¶ added in v0.5.17
ExtractKidFromIDToken 从 id_token 提取 kid
func GetOAuthURLIdentifierKey ¶ added in v0.5.17
Types ¶
type GetPublicKeyResp ¶ added in v0.5.17
type GetPublicKeyResp struct { Keys []struct { Kid string `json:"kid"` N string `json:"n"` E string `json:"e"` } `json:"keys"` }
GetPublicKeyResp 获取公钥响应参数
type OAuth ¶
type OAuth struct {
// contains filtered or unexported fields
}
func (*OAuth) BuildAuthPageURL ¶ added in v0.5.17
func (*OAuth) HandleOAuth2ByAPPAuthToken ¶ added in v0.5.17
func (*OAuth) HandleOAuth2ByAuthCode ¶ added in v0.5.17
type Option ¶
type Option func(o *Options)
func WithClientID ¶
func WithClientSecret ¶
func WithClientSecretFile ¶
func WithRedirectURL ¶
func WithTeamId ¶
Click to show internal directories.
Click to hide internal directories.