auth

package
v0.0.0-...-81acb82 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGoogleOAuth2AuthorizationUrl

func GetGoogleOAuth2AuthorizationUrl(redirectUrl string, state string) (string, *errors.VironError)

func IsSignedOut

func IsSignedOut(ctx context.Context, token string) bool

func NewGoogleOAuth2

func NewGoogleOAuth2(googleOAuth2 *config.GoogleOAuth2)

func SetUp

func SetUp(secret string, provider func(r *http.Request) (string, []string, error), expiration int) error

func Sign

func Sign(r *http.Request, subject string) (string, error)

func SignOut

func SignOut(ctx context.Context, token string) bool

func SigninEmail

func SigninEmail(r *http.Request, email string, password string) (string, *errors.VironError)

SigninEmail Emailアドレスでサインイン

func SigninGoogleOAuth2

func SigninGoogleOAuth2(code string, redirectUrl string, r *http.Request) (string, *errors.VironError)

Types

type Claim

type Claim struct {
	Exp int
	Iat int
	Nbf int
	Sub string
	Iss string
	Aud []string
}

func Verify

func Verify(r *http.Request, token string) (*Claim, error)

type Config

type Config struct {
	Secret        string
	Provider      string
	ExpirationSec int
}

type JWT

type JWT struct {
	Secret        string
	Provider      func(r *http.Request) (string, []string, error)
	ExpirationSec int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL