goauth2

package module
v0.0.0-...-4806e31 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: BSD-3-Clause Imports: 12 Imported by: 0

README

Go OAuth2 Server

Build Status Go Report Card Test Coverage Maintainability GoDoc Go Version Release License

An OAuth2 server in Go. This project uses an embedded RangeDB event store.

Docs

Docker

docker run -p 8080:8080 inklabs/goauth2

Client Credentials Grant

+---------+                                  +---------------+
|         |                                  |               |
|         |>--(A)- Client Authentication --->| Authorization |
| Client  |                                  |     Server    |
|         |<--(B)---- Access Token ---------<|               |
|         |                                  |               |
+---------+                                  +---------------+
curl localhost:8080/token \
    -u client_id_hash:client_secret_hash \
    -d "grant_type=client_credentials" \
    -d "scope=read_write"
{
  "access_token": "d5f4985587ea46028c0946e4a240a9c1",
  "expires_at": 1574371565,
  "token_type": "Bearer",
  "scope": "read_write"
}

Resource Owner Password Credentials

+----------+
| Resource |
|  Owner   |
|          |
+----------+
     v
     |    Resource Owner
     (A) Password Credentials
     |
     v
+---------+                                  +---------------+
|         |>--(B)---- Resource Owner ------->|               |
|         |         Password Credentials     | Authorization |
| Client  |                                  |     Server    |
|         |<--(C)---- Access Token ---------<|               |
|         |    (w/ Optional Refresh Token)   |               |
+---------+                                  +---------------+
curl localhost:8080/token \
    -u client_id_hash:client_secret_hash \
    -d "grant_type=password" \
    -d "username=john@example.com" \
    -d "password=Pass123!" \
    -d "scope=read_write"
{
  "access_token": "a3c5300be4d24e65a68176c7ba521c50",
  "expires_at": 1574371565,
  "token_type": "Bearer",
  "scope": "read_write",
  "refresh_token": "3a801b1fc3d847599b3d5719d82bca7b"
}

Refresh Token

+--------+                                           +---------------+
|        |--(A)------- Authorization Grant --------->|               |
|        |                                           |               |
|        |<-(B)----------- Access Token -------------|               |
|        |               & Refresh Token             |               |
|        |                                           |               |
|        |                            +----------+   |               |
|        |--(C)---- Access Token ---->|          |   |               |
|        |                            |          |   |               |
|        |<-(D)- Protected Resource --| Resource |   | Authorization |
| Client |                            |  Server  |   |     Server    |
|        |--(E)---- Access Token ---->|          |   |               |
|        |                            |          |   |               |
|        |<-(F)- Invalid Token Error -|          |   |               |
|        |                            +----------+   |               |
|        |                                           |               |
|        |--(G)----------- Refresh Token ----------->|               |
|        |                                           |               |
|        |<-(H)----------- Access Token -------------|               |
+--------+           & Optional Refresh Token        +---------------+
curl localhost:8080/token \
    -u client_id_hash:client_secret_hash \
    -d "grant_type=refresh_token" \
    -d "refresh_token=3a801b1fc3d847599b3d5719d82bca7b"
{
  "access_token": "97ed11d0d399454eb5ab2cab8b29f600",
  "expires_at": 1574371565,
  "token_type": "Bearer",
  "scope": "read_write",
  "refresh_token": "b4c69a71124641739f6a83b786b332d3"
}

Authorization Code

+----------+
| Resource |
|   Owner  |
|          |
+----------+
     ^
     |
    (B)
+----|-----+          Client Identifier      +---------------+
|         -+----(A)-- & Redirection URI ---->|               |
|  User-   |                                 | Authorization |
|  Agent  -+----(B)-- User authenticates --->|     Server    |
|          |                                 |               |
|         -+----(C)-- Authorization Code ---<|               |
+-|----|---+                                 +---------------+
  |    |                                         ^      v
 (A)  (C)                                        |      |
  |    |                                         |      |
  ^    v                                         |      |
+---------+                                      |      |
|         |>---(D)-- Authorization Code ---------'      |
|  Client |          & Redirection URI                  |
|         |                                             |
|         |<---(E)----- Access Token -------------------'
+---------+       (w/ Optional Refresh Token)
open http://localhost:8080/authorize?client_id=client_id_hash&redirect_uri=https%3A%2F%2Fexample.com%2Foauth2%2Fcallback&response_type=code&state=somestate&scope=read_write
  1. Login via the web form (john@example.com | Pass123!)
  2. Click button to grant access
  3. The authorization server redirects back to the redirection URI including an authorization code and any state provided by the client
https://example.com/oauth2/callback?code=36e2807ee1f94252ac2d9b1d3adf2ba2&state=somestate
curl localhost:8080/token \
    -u client_id_hash:client_secret_hash \
    -d "grant_type=authorization_code" \
    -d "code=36e2807ee1f94252ac2d9b1d3adf2ba2" \
    -d "redirect_uri=https://example.com/oauth2/callback"
{
  "access_token": "865382b944024b2394167d519fa80cba",
  "expires_at": 1574371565,
  "token_type": "Bearer",
  "scope": "read_write",
  "refresh_token": "48403032170e46e8af72b7cca1612b43"
}

Implicit

+----------+
| Resource |
|  Owner   |
|          |
+----------+
     ^
     |
    (B)
+----|-----+          Client Identifier     +---------------+
|         -+----(A)-- & Redirection URI --->|               |
|  User-   |                                | Authorization |
|  Agent  -|----(B)-- User authenticates -->|     Server    |
|          |                                |               |
|          |<---(C)--- Redirection URI ----<|               |
|          |          with Access Token     +---------------+
|          |            in Fragment
|          |                                +---------------+
|          |----(D)--- Redirection URI ---->|   Web-Hosted  |
|          |          without Fragment      |     Client    |
|          |                                |    Resource   |
|     (F)  |<---(E)------- Script ---------<|               |
|          |                                +---------------+
+-|--------+
  |    |
 (A)  (G) Access Token
  |    |
  ^    v
+---------+
|         |
|  Client |
|         |
+---------+
open http://localhost:8080/authorize?client_id=client_id_hash&redirect_uri=https%3A%2F%2Fexample.com%2Foauth2%2Fcallback&response_type=token&state=somestate&scope=read_write
  1. Login via the web form (john@example.com | Pass123!)
  2. Click button to grant access
  3. The authorization server redirects back to the redirection URI including an access token and any state provided by the client in the URI fragment
https://example.com/oauth2/callback#access_token=1e21103279e549779a9b5c07d50e641d&expires_at=1574371565&scope=read_write&state=somestate&token_type=Bearer

Documentation

Index

Constants

View Source
const Version = "0.1.0-dev"

Version for Go OAuth2.

Variables

View Source
var ErrAuthorizationCodeNotFound = fmt.Errorf("authorization code not found")

ErrAuthorizationCodeNotFound is a defined error for missing authorization code.

Functions

func AuthorizationCodeCommandTypes

func AuthorizationCodeCommandTypes() []string

AuthorizationCodeCommandTypes returns all command types goauth2.authorizationCode supports.

func ClientApplicationCommandTypes

func ClientApplicationCommandTypes() []string

ClientApplicationCommandTypes returns all command types goauth2.clientApplication supports.

func GeneratePasswordHash

func GeneratePasswordHash(password string) string

GeneratePasswordHash returns a password using bcrypt.GenerateFromPassword.

func RefreshTokenCommandTypes

func RefreshTokenCommandTypes() []string

RefreshTokenCommandTypes returns all command types goauth2.refreshToken supports.

func ResourceOwnerCommandTypes

func ResourceOwnerCommandTypes() []string

ResourceOwnerCommandTypes returns all command types goauth2.resourceOwner supports.

func VerifyPassword

func VerifyPassword(hash string, password string) bool

VerifyPassword verifies a password using bcrypt.CompareHashAndPassword.

Types

type AccessTokenWasIssuedToClientApplicationViaClientCredentialsGrant

type AccessTokenWasIssuedToClientApplicationViaClientCredentialsGrant struct {
	ClientID  string `json:"clientID"`
	ExpiresAt int64  `json:"expiresAt"`
	Scope     string `json:"scope"`
}

type AccessTokenWasIssuedToUserViaAuthorizationCodeGrant

type AccessTokenWasIssuedToUserViaAuthorizationCodeGrant struct {
	AuthorizationCode string `json:"authorizationCode"`
	UserID            string `json:"userID"`
	ClientID          string `json:"clientID"`
	Scope             string `json:"scope"`
	ExpiresAt         int64  `json:"expiresAt"`
}

type AccessTokenWasIssuedToUserViaImplicitGrant

type AccessTokenWasIssuedToUserViaImplicitGrant struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type AccessTokenWasIssuedToUserViaROPCGrant

type AccessTokenWasIssuedToUserViaROPCGrant struct {
	UserID    string `json:"userID"`
	ClientID  string `json:"clientID"`
	ExpiresAt int64  `json:"expiresAt"`
	Scope     string `json:"scope"`
}

type AccessTokenWasIssuedToUserViaRefreshTokenGrant

type AccessTokenWasIssuedToUserViaRefreshTokenGrant struct {
	RefreshToken string `json:"refreshToken"`
	UserID       string `json:"userID"`
	ClientID     string `json:"clientID"`
	Scope        string `json:"scope"`
	ExpiresAt    int64  `json:"expiresAt"`
}

type AccessTokenWasRevokedDueToPreviouslyUsedRefreshToken

type AccessTokenWasRevokedDueToPreviouslyUsedRefreshToken struct {
	RefreshToken string `json:"refreshToken"`
}

type App

type App struct {
	// contains filtered or unexported fields
}

App is the OAuth2 CQRS application.

func New

func New(options ...Option) (*App, error)

New constructs an OAuth2 CQRS application.

func (*App) Dispatch

func (a *App) Dispatch(command Command) []rangedb.Event

Dispatch dispatches a command returning all persisted rangedb.Event's.

func (*App) SubscribeAndReplay

func (a *App) SubscribeAndReplay(subscribers ...rangedb.RecordSubscriber) error

SubscribeAndReplay subscribes and replays all events starting with zero.

type AuthorizationCodeRefreshTokens

type AuthorizationCodeRefreshTokens struct {
	// contains filtered or unexported fields
}

AuthorizationCodeRefreshTokens is a projection mapping authorization codes to refresh tokens.

func NewAuthorizationCodeRefreshTokens

func NewAuthorizationCodeRefreshTokens() *AuthorizationCodeRefreshTokens

NewAuthorizationCodeRefreshTokens constructs an AuthorizationCodeRefreshTokens projection.

func (*AuthorizationCodeRefreshTokens) Accept

func (a *AuthorizationCodeRefreshTokens) Accept(record *rangedb.Record)

Accept receives a rangedb.Record.

func (*AuthorizationCodeRefreshTokens) GetAuthorizationCode

func (a *AuthorizationCodeRefreshTokens) GetAuthorizationCode(refreshToken string) (string, error)

GetAuthorizationCode returns a single authorization code from a refresh token.

func (*AuthorizationCodeRefreshTokens) GetTokens

func (a *AuthorizationCodeRefreshTokens) GetTokens(authorizationCode string) []string

GetTokens returns all refresh tokens by authorizationCode.

type AuthorizationCodeWasIssuedToUser

type AuthorizationCodeWasIssuedToUser struct {
	AuthorizationCode string `json:"authorizationCode"`
	UserID            string `json:"userID"`
	ClientID          string `json:"clientID"`
	ExpiresAt         int64  `json:"expiresAt"`
	Scope             string `json:"scope"`
}

type AuthorizationCodeWasIssuedToUserViaAuthorizationCodeGrant

type AuthorizationCodeWasIssuedToUserViaAuthorizationCodeGrant struct {
	UserID            string `json:"userID"`
	ClientID          string `json:"clientID"`
	AuthorizationCode string `json:"authorizationCode"`
	ExpiresAt         int64  `json:"expiresAt"`
	Scope             string `json:"scope"`
}

type AuthorizeUserToOnBoardClientApplications

type AuthorizeUserToOnBoardClientApplications struct {
	UserID            string `json:"userID"`
	AuthorizingUserID string `json:"authorizingUserID"`
}

type AuthorizeUserToOnBoardClientApplicationsWasRejectedDueToMissingAuthorizingUser

type AuthorizeUserToOnBoardClientApplicationsWasRejectedDueToMissingAuthorizingUser struct {
	UserID            string `json:"userID"`
	AuthorizingUserID string `json:"authorizingUserID"`
}

type AuthorizeUserToOnBoardClientApplicationsWasRejectedDueToMissingTargetUser

type AuthorizeUserToOnBoardClientApplicationsWasRejectedDueToMissingTargetUser struct {
	UserID            string `json:"userID"`
	AuthorizingUserID string `json:"authorizingUserID"`
}

type AuthorizeUserToOnBoardClientApplicationsWasRejectedDueToNonAdministrator

type AuthorizeUserToOnBoardClientApplicationsWasRejectedDueToNonAdministrator struct {
	UserID            string `json:"userID"`
	AuthorizingUserID string `json:"authorizingUserID"`
}

type ClientApplicationWasOnBoarded

type ClientApplicationWasOnBoarded struct {
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
	RedirectURI  string `json:"redirectURI"`
	UserID       string `json:"userID"`
}

type Command

type Command interface {
	rangedb.AggregateMessage
	CommandType() string
}

Command is the interface for CQRS commands.

type CommandDispatcher

type CommandDispatcher func(command Command) []rangedb.Event

type CommandHandler

type CommandHandler interface {
	PendingEvents
	Handle(command Command)
}

type CommandHandlerFactory

type CommandHandlerFactory func(command Command) CommandHandler

type GrantUserAdministratorRole

type GrantUserAdministratorRole struct {
	UserID         string `json:"userID"`
	GrantingUserID string `json:"grantingUserID"`
}

type GrantUserAdministratorRoleWasRejectedDueToMissingGrantingUser

type GrantUserAdministratorRoleWasRejectedDueToMissingGrantingUser struct {
	UserID         string `json:"userID"`
	GrantingUserID string `json:"grantingUserID"`
}

type GrantUserAdministratorRoleWasRejectedDueToMissingTargetUser

type GrantUserAdministratorRoleWasRejectedDueToMissingTargetUser struct {
	UserID         string `json:"userID"`
	GrantingUserID string `json:"grantingUserID"`
}

type GrantUserAdministratorRoleWasRejectedDueToNonAdministrator

type GrantUserAdministratorRoleWasRejectedDueToNonAdministrator struct {
	UserID         string `json:"userID"`
	GrantingUserID string `json:"grantingUserID"`
}

type IssueAuthorizationCodeToUser

type IssueAuthorizationCodeToUser struct {
	AuthorizationCode string `json:"authorizationCode"`
	UserID            string `json:"userID"`
	ClientID          string `json:"clientID"`
	ExpiresAt         int64  `json:"expiresAt"`
	Scope             string `json:"scope"`
}

type IssueRefreshTokenToUser

type IssueRefreshTokenToUser struct {
	RefreshToken string `json:"refreshToken"`
	UserID       string `json:"userID"`
	ClientID     string `json:"clientID"`
	Scope        string `json:"scope"`
}

type OnBoardClientApplication

type OnBoardClientApplication struct {
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
	RedirectURI  string `json:"redirectURI"`
	UserID       string `json:"userID"`
}

type OnBoardClientApplicationWasRejectedDueToInsecureRedirectURI

type OnBoardClientApplicationWasRejectedDueToInsecureRedirectURI struct {
	ClientID    string `json:"clientID"`
	RedirectURI string `json:"redirectURI"`
}

type OnBoardClientApplicationWasRejectedDueToInvalidRedirectURI

type OnBoardClientApplicationWasRejectedDueToInvalidRedirectURI struct {
	ClientID    string `json:"clientID"`
	RedirectURI string `json:"redirectURI"`
}

type OnBoardClientApplicationWasRejectedDueToUnAuthorizeUser

type OnBoardClientApplicationWasRejectedDueToUnAuthorizeUser struct {
	ClientID string `json:"clientID"`
	UserID   string `json:"userID"`
}

type OnBoardUser

type OnBoardUser struct {
	UserID         string `json:"userID"`
	Username       string `json:"username"`
	Password       string `json:"password"`
	GrantingUserID string `json:"grantingUserID"`
}

type OnBoardUserWasRejectedDueToExistingUser

type OnBoardUserWasRejectedDueToExistingUser struct {
	UserID         string `json:"userID"`
	GrantingUserID string `json:"grantingUserID"`
}

type OnBoardUserWasRejectedDueToInsecurePassword

type OnBoardUserWasRejectedDueToInsecurePassword struct {
	UserID         string `json:"userID"`
	GrantingUserID string `json:"grantingUserID"`
}

type OnBoardUserWasRejectedDueToNonAdministrator

type OnBoardUserWasRejectedDueToNonAdministrator struct {
	UserID         string `json:"userID"`
	GrantingUserID string `json:"grantingUserID"`
}

type Option

type Option func(*App)

Option defines functional option parameters for App.

func WithClock

func WithClock(clock clock.Clock) Option

WithClock is a functional option to inject a clock.

func WithLogger

func WithLogger(logger *log.Logger) Option

WithLogger is a functional option to inject a Logger.

func WithStore

func WithStore(store rangedb.Store) Option

WithStore is a functional option to inject a RangeDB Event Store.

func WithTokenGenerator

func WithTokenGenerator(generator TokenGenerator) Option

WithTokenGenerator is a functional option to inject a token generator.

type PendingEvents

type PendingEvents interface {
	GetPendingEvents() []rangedb.Event
}

PendingEvents is the interface for retrieving CQRS events that will be saved to the event store.

type PreCommandHandler

type PreCommandHandler interface {
	PendingEvents
	CommandTypes() []string
	Handle(command Command) (shouldContinue bool)
}

type RefreshTokenWasIssuedToUser

type RefreshTokenWasIssuedToUser struct {
	RefreshToken string `json:"refreshToken"`
	UserID       string `json:"userID"`
	ClientID     string `json:"clientID"`
	Scope        string `json:"scope"`
}

type RefreshTokenWasIssuedToUserViaAuthorizationCodeGrant

type RefreshTokenWasIssuedToUserViaAuthorizationCodeGrant struct {
	AuthorizationCode string `json:"authorizationCode"`
	ClientID          string `json:"clientID"`
	UserID            string `json:"userID"`
	RefreshToken      string `json:"refreshToken"`
	Scope             string `json:"scope"`
}

type RefreshTokenWasIssuedToUserViaROPCGrant

type RefreshTokenWasIssuedToUserViaROPCGrant struct {
	UserID       string `json:"userID"`
	ClientID     string `json:"clientID"`
	RefreshToken string `json:"refreshToken"`
	Scope        string `json:"scope"`
}

type RefreshTokenWasIssuedToUserViaRefreshTokenGrant

type RefreshTokenWasIssuedToUserViaRefreshTokenGrant struct {
	RefreshToken     string `json:"refreshToken"`
	UserID           string `json:"userID"`
	ClientID         string `json:"clientID"`
	NextRefreshToken string `json:"nextRefreshToken"`
	Scope            string `json:"scope"`
}

type RefreshTokenWasRevokedFromUser

type RefreshTokenWasRevokedFromUser struct {
	RefreshToken string `json:"refreshToken"`
	UserID       string `json:"userID"`
	ClientID     string `json:"clientID"`
}

type RequestAccessTokenViaAuthorizationCodeGrant

type RequestAccessTokenViaAuthorizationCodeGrant struct {
	AuthorizationCode string `json:"authorizationCode"`
	ClientID          string `json:"clientID"`
	ClientSecret      string `json:"clientSecret"`
	RedirectURI       string `json:"redirectURI"`
}

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToExpiredAuthorizationCode

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToExpiredAuthorizationCode struct {
	AuthorizationCode string `json:"authorizationCode"`
	ClientID          string `json:"clientID"`
}

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToInvalidAuthorizationCode

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToInvalidAuthorizationCode struct {
	AuthorizationCode string `json:"authorizationCode"`
	ClientID          string `json:"clientID"`
}

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationID

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationID struct {
	AuthorizationCode string `json:"authorizationCode"`
	ClientID          string `json:"clientID"`
}

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationRedirectURI

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationRedirectURI struct {
	AuthorizationCode string `json:"authorizationCode"`
	ClientID          string `json:"clientID"`
	RedirectURI       string `json:"redirectURI"`
}

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationSecret

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationSecret struct {
	AuthorizationCode string `json:"authorizationCode"`
	ClientID          string `json:"clientID"`
}

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToPreviouslyUsedAuthorizationCode

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToPreviouslyUsedAuthorizationCode struct {
	AuthorizationCode string `json:"authorizationCode"`
	ClientID          string `json:"clientID"`
	UserID            string `json:"userID"`
}

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToUnmatchedClientApplicationID

type RequestAccessTokenViaAuthorizationCodeGrantWasRejectedDueToUnmatchedClientApplicationID struct {
	AuthorizationCode string `json:"authorizationCode"`
	RequestedClientID string `json:"requestedClientID"`
	ActualClientID    string `json:"actualClientID"`
}

type RequestAccessTokenViaClientCredentialsGrant

type RequestAccessTokenViaClientCredentialsGrant struct {
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
	Scope        string `json:"scope"`
}

type RequestAccessTokenViaClientCredentialsGrantWasRejectedDueToInvalidClientApplicationID

type RequestAccessTokenViaClientCredentialsGrantWasRejectedDueToInvalidClientApplicationID struct {
	ClientID string `json:"clientID"`
}

type RequestAccessTokenViaClientCredentialsGrantWasRejectedDueToInvalidClientApplicationSecret

type RequestAccessTokenViaClientCredentialsGrantWasRejectedDueToInvalidClientApplicationSecret struct {
	ClientID string `json:"clientID"`
}

type RequestAccessTokenViaImplicitGrant

type RequestAccessTokenViaImplicitGrant struct {
	UserID      string `json:"userID"`
	ClientID    string `json:"clientID"`
	RedirectURI string `json:"redirectURI"`
	Username    string `json:"username"`
	Password    string `json:"password"`
}

type RequestAccessTokenViaImplicitGrantWasRejectedDueToInvalidClientApplicationID

type RequestAccessTokenViaImplicitGrantWasRejectedDueToInvalidClientApplicationID struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type RequestAccessTokenViaImplicitGrantWasRejectedDueToInvalidClientApplicationRedirectURI

type RequestAccessTokenViaImplicitGrantWasRejectedDueToInvalidClientApplicationRedirectURI struct {
	UserID      string `json:"userID"`
	ClientID    string `json:"clientID"`
	RedirectURI string `json:"redirectURI"`
}

type RequestAccessTokenViaImplicitGrantWasRejectedDueToInvalidUser

type RequestAccessTokenViaImplicitGrantWasRejectedDueToInvalidUser struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type RequestAccessTokenViaImplicitGrantWasRejectedDueToInvalidUserPassword

type RequestAccessTokenViaImplicitGrantWasRejectedDueToInvalidUserPassword struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type RequestAccessTokenViaROPCGrant

type RequestAccessTokenViaROPCGrant struct {
	UserID       string `json:"userID"`
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
	Username     string `json:"username"`
	Password     string `json:"password"`
	Scope        string `json:"scope"`
}

type RequestAccessTokenViaROPCGrantWasRejectedDueToInvalidClientApplicationCredentials

type RequestAccessTokenViaROPCGrantWasRejectedDueToInvalidClientApplicationCredentials struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type RequestAccessTokenViaROPCGrantWasRejectedDueToInvalidUser

type RequestAccessTokenViaROPCGrantWasRejectedDueToInvalidUser struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type RequestAccessTokenViaROPCGrantWasRejectedDueToInvalidUserPassword

type RequestAccessTokenViaROPCGrantWasRejectedDueToInvalidUserPassword struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type RequestAccessTokenViaRefreshTokenGrant

type RequestAccessTokenViaRefreshTokenGrant struct {
	RefreshToken string `json:"refreshToken"`
	ClientID     string `json:"clientID"`
	ClientSecret string `json:"clientSecret"`
	Scope        string `json:"scope"`
}

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToInvalidClientApplicationCredentials

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToInvalidClientApplicationCredentials struct {
	RefreshToken string `json:"refreshToken"`
	ClientID     string `json:"clientID"`
}

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToInvalidRefreshToken

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToInvalidRefreshToken struct {
	RefreshToken string `json:"refreshToken"`
	ClientID     string `json:"clientID"`
}

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToInvalidScope

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToInvalidScope struct {
	RefreshToken   string `json:"refreshToken"`
	ClientID       string `json:"clientID"`
	Scope          string `json:"scope"`
	RequestedScope string `json:"requestedScope"`
}

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToPreviouslyUsedRefreshToken

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToPreviouslyUsedRefreshToken struct {
	RefreshToken string `json:"refreshToken"`
}

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToRevokedRefreshToken

type RequestAccessTokenViaRefreshTokenGrantWasRejectedDueToRevokedRefreshToken struct {
	RefreshToken string `json:"refreshToken"`
	ClientID     string `json:"clientID"`
}

type RequestAuthorizationCodeViaAuthorizationCodeGrant

type RequestAuthorizationCodeViaAuthorizationCodeGrant struct {
	UserID      string `json:"userID"`
	ClientID    string `json:"clientID"`
	RedirectURI string `json:"redirectURI"`
	Username    string `json:"username"`
	Password    string `json:"password"`
	Scope       string `json:"scope"`
}

type RequestAuthorizationCodeViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationID

type RequestAuthorizationCodeViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationID struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type RequestAuthorizationCodeViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationRedirectURI

type RequestAuthorizationCodeViaAuthorizationCodeGrantWasRejectedDueToInvalidClientApplicationRedirectURI struct {
	UserID      string `json:"userID"`
	ClientID    string `json:"clientID"`
	RedirectURI string `json:"redirectURI"`
}

type RequestAuthorizationCodeViaAuthorizationCodeGrantWasRejectedDueToInvalidUser

type RequestAuthorizationCodeViaAuthorizationCodeGrantWasRejectedDueToInvalidUser struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type RequestAuthorizationCodeViaAuthorizationCodeGrantWasRejectedDueToInvalidUserPassword

type RequestAuthorizationCodeViaAuthorizationCodeGrantWasRejectedDueToInvalidUserPassword struct {
	UserID   string `json:"userID"`
	ClientID string `json:"clientID"`
}

type RevokeRefreshTokenFromUser

type RevokeRefreshTokenFromUser struct {
	RefreshToken string `json:"refreshToken"`
	UserID       string `json:"userID"`
	ClientID     string `json:"clientID"`
}

type TokenGenerator

type TokenGenerator interface {
	New() string
}

TokenGenerator defines a token generator for refresh tokens and authorization codes.

type UserWasAuthorizedToOnBoardClientApplications

type UserWasAuthorizedToOnBoardClientApplications struct {
	UserID            string `json:"userID"`
	AuthorizingUserID string `json:"authorizingUserID"`
}

type UserWasGrantedAdministratorRole

type UserWasGrantedAdministratorRole struct {
	UserID         string `json:"userID"`
	GrantingUserID string `json:"grantingUserID"`
}

type UserWasOnBoarded

type UserWasOnBoarded struct {
	UserID         string `json:"userID"`
	Username       string `json:"username"`
	PasswordHash   string `json:"passwordHash"`
	GrantingUserID string `json:"grantingUserID"`
}

Directories

Path Synopsis
cmd
pkg
provider

Jump to

Keyboard shortcuts

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