mirror of
https://github.com/davidallendj/opaal.git
synced 2025-12-20 11:37:01 -07:00
Minor changes
This commit is contained in:
parent
d1f9f9e46c
commit
3434368210
3 changed files with 8 additions and 2 deletions
|
|
@ -169,7 +169,7 @@ func Login(config *Config) error {
|
|||
fmt.Printf("failed to fetch JWK: %v\n", err)
|
||||
} else {
|
||||
fmt.Printf("Attempting to add issuer to authorization server...\n")
|
||||
err = AddTrustedIssuer(config.ActionUrls.TrustedIssuers, *idp, subject, time.Duration(1000), config.Scope)
|
||||
err = AddTrustedIssuer(config.ActionUrls.TrustedIssuers, idp, subject, time.Duration(1000), config.Scope)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to add trusted issuer: %v", err)
|
||||
}
|
||||
|
|
@ -256,8 +256,11 @@ func FetchAccessToken(remoteUrl string, clientId string, jwt string, scopes []st
|
|||
return token, nil
|
||||
}
|
||||
|
||||
func AddTrustedIssuer(remoteUrl string, idp oidc.IdentityProvider, subject string, duration time.Duration, scope []string) error {
|
||||
func AddTrustedIssuer(remoteUrl string, idp *oidc.IdentityProvider, subject string, duration time.Duration, scope []string) error {
|
||||
// hydra endpoint: /admin/trust/grants/jwt-bearer/issuers
|
||||
if idp == nil {
|
||||
return fmt.Errorf("identity provided is nil")
|
||||
}
|
||||
jwkstr, err := json.Marshal(idp.Key)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to marshal JWK: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue