accessToken will store an access_token in-memory based on the provided information
(applicationID, refreshTokenID, subject string, audience, scopes []string)
| 643 | |
| 644 | // accessToken will store an access_token in-memory based on the provided information |
| 645 | func (s *Storage) accessToken(applicationID, refreshTokenID, subject string, audience, scopes []string) (*Token, error) { |
| 646 | s.lock.Lock() |
| 647 | defer s.lock.Unlock() |
| 648 | token := &Token{ |
| 649 | ID: uuid.NewString(), |
| 650 | ApplicationID: applicationID, |
| 651 | RefreshTokenID: refreshTokenID, |
| 652 | Subject: subject, |
| 653 | Audience: audience, |
| 654 | Expiration: time.Now().Add(s.accessTokenExpiration), |
| 655 | Scopes: scopes, |
| 656 | } |
| 657 | s.tokens[token.ID] = token |
| 658 | return token, nil |
| 659 | } |
| 660 | |
| 661 | // setUserinfo sets the info based on the user, scopes and if necessary the clientID |
| 662 | func (s *Storage) setUserinfo(ctx context.Context, userInfo *oidc.UserInfo, userID, clientID string, scopes []string) (err error) { |
no test coverage detected