forked from TrueCloudLab/certificates
Rename and reformat to PreferredUsername
This commit is contained in:
parent
09a21fef26
commit
79eec83f3e
1 changed files with 13 additions and 13 deletions
|
@ -44,7 +44,7 @@ type openIDPayload struct {
|
||||||
AuthorizedParty string `json:"azp"`
|
AuthorizedParty string `json:"azp"`
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
EmailVerified bool `json:"email_verified"`
|
EmailVerified bool `json:"email_verified"`
|
||||||
Username string `json:"preferred_username"`
|
PreferredUsername string `json:"preferred_username"`
|
||||||
Hd string `json:"hd"`
|
Hd string `json:"hd"`
|
||||||
Nonce string `json:"nonce"`
|
Nonce string `json:"nonce"`
|
||||||
Groups []string `json:"groups"`
|
Groups []string `json:"groups"`
|
||||||
|
@ -394,9 +394,9 @@ func (o *OIDC) AuthorizeSSHSign(ctx context.Context, token string) ([]SignOption
|
||||||
return nil, errs.Wrap(http.StatusInternalServerError, err, "oidc.AuthorizeSSHSign")
|
return nil, errs.Wrap(http.StatusInternalServerError, err, "oidc.AuthorizeSSHSign")
|
||||||
}
|
}
|
||||||
// Reuse the contains function provided for simplicity
|
// Reuse the contains function provided for simplicity
|
||||||
if !containsAllMembers(iden.Usernames, []string{claims.Username}){
|
if !containsAllMembers(iden.Usernames, []string{claims.PreferredUsername}) {
|
||||||
// Add preferred_username to the identity's Username
|
// Add preferred_username to the identity's Username
|
||||||
iden.Usernames = append(iden.Usernames, claims.Username)
|
iden.Usernames = append(iden.Usernames, claims.PreferredUsername)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Certificate templates.
|
// Certificate templates.
|
||||||
|
|
Loading…
Reference in a new issue