Documentation
¶
Index ¶
- func IsSignedOut(ctx context.Context, token string) bool
- func SetUpJWT(secret string, provider func(r *http.Request) (string, []string, error), ...) error
- func Sign(r *http.Request, subject string) (string, error)
- func SignOut(ctx context.Context, token string) bool
- func SigninEmail(r *http.Request, email string, password string) (string, *errors.VironError)
- func VerifyToken(token string) (jwxJwt.Token, error)
- type Auth
- func (a *Auth) GenGoogleOAuth2AuthorizationUrl(clientID string, redirectUrl string, codeVerifier string, state string) string
- func (a *Auth) GenGoogleOAuth2CodeVerifier(clientID string) string
- func (a *Auth) GenOIDCAuthorizationUrl(clientID string, redirectUrl string, codeVerifier string, state string) string
- func (a *Auth) GenOIDCCodeVerifier(clientID string) string
- func (a *Auth) SigninGoogleOAuth2(r *http.Request, clientID string, redirectUrl string, code string, ...) (string, *errors.VironError)
- func (a *Auth) SigninOIDC(r *http.Request, clientID string, redirectUrl string, code string, ...) (string, *errors.VironError)
- func (a *Auth) VerifyAccessToken(r *http.Request, clientID string, userID string, user domains.AdminUser) bool
- type AuthOIDC
- type Claim
- type OAuthProvider
- type OAuthProviderImpl
- func (m *OAuthProviderImpl) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
- func (m *OAuthProviderImpl) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
- func (m *OAuthProviderImpl) TokenSource(ctx context.Context, token *oauth2.Token) oauth2.TokenSource
- type OIDCProvider
- type OIDCProviderFactory
- type OIDCProviderFactoryImpl
- type OIDCProviderImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SigninEmail ¶
SigninEmail Emailアドレスでサインイン
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
func New ¶
func New(multipleAuthUser *bool, google *config.GoogleOAuth2, oidcConfig *config.OIDC, providerFactory OIDCProviderFactory) *Auth
New Auth初期化
func (*Auth) GenGoogleOAuth2AuthorizationUrl ¶
func (a *Auth) GenGoogleOAuth2AuthorizationUrl(clientID string, redirectUrl string, codeVerifier string, state string) string
GenGoogleOAuth2AuthorizationUrlIDC Authorization URL生成
func (*Auth) GenGoogleOAuth2CodeVerifier ¶
GenGoogleOAuth2CodeVerifier Code Verifier生成
func (*Auth) GenOIDCAuthorizationUrl ¶
func (a *Auth) GenOIDCAuthorizationUrl(clientID string, redirectUrl string, codeVerifier string, state string) string
GenOIDCAuthorizationUrl Authorization URL生成
func (*Auth) GenOIDCCodeVerifier ¶
GenOIDCCodeVerifier Code Verifier生成
func (*Auth) SigninGoogleOAuth2 ¶
func (a *Auth) SigninGoogleOAuth2(r *http.Request, clientID string, redirectUrl string, code string, state string, codeVerifier string) (string, *errors.VironError)
SigninGoogleOAuth2
type OAuthProvider ¶
type OAuthProvider interface {
AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
TokenSource(ctx context.Context, token *oauth2.Token) oauth2.TokenSource
}
OAuthProvider インターフェース
type OAuthProviderImpl ¶
type OAuthProviderImpl struct {
// contains filtered or unexported fields
}
OAuth2Provider の具体的な実装
func (*OAuthProviderImpl) AuthCodeURL ¶
func (m *OAuthProviderImpl) AuthCodeURL(state string, opts ...oauth2.AuthCodeOption) string
AuthCodeURL OAuth2ProviderのAuthCodeURL
func (*OAuthProviderImpl) Exchange ¶
func (m *OAuthProviderImpl) Exchange(ctx context.Context, code string, opts ...oauth2.AuthCodeOption) (*oauth2.Token, error)
Exchange OAuth2ProviderのExchange
func (*OAuthProviderImpl) TokenSource ¶
func (m *OAuthProviderImpl) TokenSource(ctx context.Context, token *oauth2.Token) oauth2.TokenSource
TokenSource OAuth2ProviderのTokenSource
type OIDCProvider ¶
type OIDCProvider interface {
Verifier(config *oidc.Config) *oidc.IDTokenVerifier
Endpoint() oauth2.Endpoint
}
OIDCProvider インターフェース
type OIDCProviderFactory ¶
type OIDCProviderFactory interface {
NewProvider(ctx context.Context, issuer string) *oidc.Provider
}
OIDCProviderFactory は OIDC のプロバイダーを作成するためのインターフェース
type OIDCProviderFactoryImpl ¶
type OIDCProviderFactoryImpl struct{}
OIDCProviderFactoryImpl は本番環境用の実装
func (*OIDCProviderFactoryImpl) NewProvider ¶
NewProvider は実際の oidc.NewProvider を呼び出す
type OIDCProviderImpl ¶
type OIDCProviderImpl struct {
// contains filtered or unexported fields
}
OIDCProvider の具体的な実装
func (*OIDCProviderImpl) Endpoint ¶
func (m *OIDCProviderImpl) Endpoint() oauth2.Endpoint
Endpoint OIDCProviderのエンドポイント取得
func (*OIDCProviderImpl) Verifier ¶
func (m *OIDCProviderImpl) Verifier(config *oidc.Config) *oidc.IDTokenVerifier
Verifier OIDCProviderのIDトークン検証機取得
Click to show internal directories.
Click to hide internal directories.