lastfm: authentication

This commit is contained in:
Philipp Wolfer 2023-11-23 23:14:47 +01:00
parent 3ccbb20a9e
commit 5b8f4788f9
No known key found for this signature in database
GPG key ID: 8FDF744D4919943B
10 changed files with 158 additions and 15 deletions

View file

@ -33,8 +33,13 @@ func (s deezerStrategy) Config() oauth2.Config {
return s.conf
}
func (s deezerStrategy) AuthCodeURL(verifier string, state string) string {
return s.conf.AuthCodeURL(state, oauth2.AccessTypeOffline, oauth2.S256ChallengeOption(verifier))
func (s deezerStrategy) AuthCodeURL(verifier string, state string) auth.AuthUrl {
url := s.conf.AuthCodeURL(state, oauth2.AccessTypeOffline, oauth2.S256ChallengeOption(verifier))
return auth.AuthUrl{
Url: url,
State: state,
Param: "code",
}
}
func (s deezerStrategy) ExchangeToken(code auth.CodeResponse, verifier string) (*oauth2.Token, error) {