mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-25 14:08:09 +02:00
authenticate: always trust the passed in idp (#3931)
authenticate: always trust the passed in idp (#3917) Co-authored-by: Caleb Doxsey <cdoxsey@pomerium.com>
This commit is contained in:
parent
cc475a3985
commit
3ba74b38ae
2 changed files with 20 additions and 43 deletions
|
@ -31,12 +31,9 @@ func (a *Authenticate) buildIdentityProfile(
|
|||
oauthToken *oauth2.Token,
|
||||
) (*identitypb.Profile, error) {
|
||||
options := a.options.Load()
|
||||
idp, err := options.GetIdentityProviderForID(r.FormValue(urlutil.QueryIdentityProviderID))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("authenticate: error getting identity provider for id: %w", err)
|
||||
}
|
||||
idpID := r.FormValue(urlutil.QueryIdentityProviderID)
|
||||
|
||||
authenticator, err := a.cfg.getIdentityProvider(options, idp.GetId())
|
||||
authenticator, err := a.cfg.getIdentityProvider(options, idpID)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("authenticate: error getting identity provider authenticator: %w", err)
|
||||
}
|
||||
|
@ -57,7 +54,7 @@ func (a *Authenticate) buildIdentityProfile(
|
|||
}
|
||||
|
||||
return &identitypb.Profile{
|
||||
ProviderId: idp.GetId(),
|
||||
ProviderId: idpID,
|
||||
IdToken: rawIDToken,
|
||||
OauthToken: rawOAuthToken,
|
||||
Claims: rawClaims,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue