mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-23 03:29:51 +02:00
config: allow blank identity providers when loading sessions for service account support (#3709)
This commit is contained in:
parent
1b596115e9
commit
6a9d6e45e1
2 changed files with 25 additions and 7 deletions
|
@ -69,14 +69,16 @@ func (store *SessionStore) LoadSessionState(r *http.Request) (*sessions.State, e
|
|||
}
|
||||
|
||||
// confirm that the identity provider id matches the state
|
||||
idp, err := store.options.GetIdentityProviderForRequestURL(urlutil.GetAbsoluteURL(r).String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if state.IdentityProviderID != "" {
|
||||
idp, err := store.options.GetIdentityProviderForRequestURL(urlutil.GetAbsoluteURL(r).String())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if idp.GetId() != state.IdentityProviderID {
|
||||
return nil, fmt.Errorf("unexpected session state identity provider id: %s != %s",
|
||||
idp.GetId(), state.IdentityProviderID)
|
||||
if idp.GetId() != state.IdentityProviderID {
|
||||
return nil, fmt.Errorf("unexpected session state identity provider id: %s != %s",
|
||||
idp.GetId(), state.IdentityProviderID)
|
||||
}
|
||||
}
|
||||
|
||||
return &state, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue