createRefreshToken will store a refresh_token in-memory based on the provided information
(accessToken *Token, amr []string, authTime time.Time)
| 592 | |
| 593 | // createRefreshToken will store a refresh_token in-memory based on the provided information |
| 594 | func (s *Storage) createRefreshToken(accessToken *Token, amr []string, authTime time.Time) (string, error) { |
| 595 | s.lock.Lock() |
| 596 | defer s.lock.Unlock() |
| 597 | token := &RefreshToken{ |
| 598 | ID: accessToken.RefreshTokenID, |
| 599 | Token: accessToken.RefreshTokenID, |
| 600 | AuthTime: authTime, |
| 601 | AMR: amr, |
| 602 | ApplicationID: accessToken.ApplicationID, |
| 603 | UserID: accessToken.Subject, |
| 604 | Audience: accessToken.Audience, |
| 605 | Expiration: time.Now().Add(5 * time.Hour), |
| 606 | Scopes: accessToken.Scopes, |
| 607 | AccessToken: accessToken.ID, |
| 608 | } |
| 609 | s.refreshTokens[token.ID] = token |
| 610 | return token.Token, nil |
| 611 | } |
| 612 | |
| 613 | // renewRefreshToken checks the provided refresh_token and creates a new one based on the current |
| 614 | // |
no outgoing calls
no test coverage detected