internal/sessions: handle claims "ver" field generally (#990)

"ver" field is not specified by RFC 7519, so in practice, most providers
return it as string, but okta returns it as number, which cause okta
authenticate broken.

To fix it, we handle "ver" field more generally, to allow both string and
number in json payload.
This commit is contained in:
Cuong Manh Le 2020-06-24 22:06:17 +07:00 committed by GitHub
parent 1e3c381e1e
commit 505ff5cc5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 62 additions and 4 deletions

View file

@ -571,7 +571,7 @@ func (a *Authenticate) saveSessionToDataBroker(ctx context.Context, sessionState
if err != nil {
return fmt.Errorf("authenticate: error saving session: %w", err)
}
sessionState.Version = res.GetServerVersion()
sessionState.Version = sessions.Version(res.GetServerVersion())
return nil
}