Skip to content

Commit

Permalink
add function
Browse files Browse the repository at this point in the history
  • Loading branch information
labuladong committed Sep 22, 2023
1 parent 7cf643b commit 8d3708d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pulsaradmin/pkg/admin/auth/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ func NewAuthenticationOAuth2(issuer oauth2.Issuer, store store.Store) (*OAuth2Pr

// NewAuthenticationOAuth2WithDefaultFlow uses memory to save the grant
func NewAuthenticationOAuth2WithDefaultFlow(issuer oauth2.Issuer, keyFile string) (Provider, error) {
st := store.NewMemoryStore()
flow, err := oauth2.NewDefaultClientCredentialsFlow(oauth2.ClientCredentialsFlowOptions{
return NewAuthenticationOAuth2WithFlow(issuer, oauth2.ClientCredentialsFlowOptions{
KeyFile: keyFile,
})
}

func NewAuthenticationOAuth2WithFlow(issuer oauth2.Issuer, flowOptions oauth2.ClientCredentialsFlowOptions) (Provider, error) {
st := store.NewMemoryStore()
flow, err := oauth2.NewDefaultClientCredentialsFlow(flowOptions)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 8d3708d

Please sign in to comment.