Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
added federated claims in token request (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
enrichman authored Jun 14, 2023
1 parent 3a94eb6 commit f7e7367
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/jetstream/authepinio.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,16 @@ func (a *epinioAuth) epinioOIDCLogin(c echo.Context) (string, string, error) {
}

var claims struct {
Email string `json:"email"`
Groups []string `json:"groups"`
Profile interface{} `json:"profile"`
Email string `json:"email"`
Groups []string `json:"groups"`
FederatedClaims struct {
ConnectorID string `json:"connector_id"`
} `json:"federated_claims"`
}
log.Warnf("epinioOIDCLogin: token: %+v", idToken)

if err := idToken.Claims(&claims); err != nil {
msg := "token in unexpected format: %+v"
msg := "token in unexpected format"
log.Errorf(msg, err)
return "", "", errors.New(msg)
}
Expand Down
2 changes: 1 addition & 1 deletion src/jetstream/dex/dex.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
)

var (
DefaultScopes = []string{oidc.ScopeOpenID, oidc.ScopeOfflineAccess, "profile", "email", "groups", "audience:server:client_id:epinio-api"}
DefaultScopes = []string{oidc.ScopeOpenID, oidc.ScopeOfflineAccess, "profile", "email", "groups", "audience:server:client_id:epinio-api", "federated:id"}
)

// OIDCProvider wraps an oidc.Provider and its Configuration
Expand Down

0 comments on commit f7e7367

Please sign in to comment.