createRefreshToken will store a refresh_token in-memory based on the provided information
(accessToken *Token, amr []string, authTime time.Time)
| 600 | |
| 601 | // createRefreshToken will store a refresh_token in-memory based on the provided information |
| 602 | func (s *Storage) createRefreshToken(accessToken *Token, amr []string, authTime time.Time) (string, error) { |
| 603 | s.lock.Lock() |
| 604 | defer s.lock.Unlock() |
| 605 | token := &RefreshToken{ |
| 606 | ID: accessToken.RefreshTokenID, |
| 607 | Token: accessToken.RefreshTokenID, |
| 608 | AuthTime: authTime, |
| 609 | AMR: amr, |
| 610 | ApplicationID: accessToken.ApplicationID, |
| 611 | UserID: accessToken.Subject, |
| 612 | Audience: accessToken.Audience, |
| 613 | Expiration: time.Now().Add(s.refreshTokenExpiration), |
| 614 | Scopes: accessToken.Scopes, |
| 615 | } |
| 616 | s.refreshTokens[token.ID] = token |
| 617 | return token.Token, nil |
| 618 | } |
| 619 | |
| 620 | // renewRefreshToken checks the provided refresh_token and creates a new one based on the current |
| 621 | func (s *Storage) renewRefreshToken(currentRefreshToken string) (string, string, error) { |
no test coverage detected