polyvariant / sttp-oauth2

OAuth2 client library implemented in Scala using sttp
https://sttp-oauth2.polyvariant.org
Apache License 2.0
74 stars 22 forks source link

Support custom login/token URLs #9

Closed kubukoz closed 3 years ago

kubukoz commented 3 years ago

e.g. Spotify uses an /authorize path instead of /login.

Current workaround:

val uri = AuthorizationCodeProvider[Uri, F].loginLink(scope = scopes).path("authorize")

A similar situation happens for the /token path - in Spotify it's /api/token.

bwiercinski commented 3 years ago

we can consider adding in com.ocadotechnology.sttp.oauth2.AuthorizationCodeProvider#uriInstance (and in other constructors) a parameter, something like: case class AuthorizationCodeConfig(loginPath=List("login"), logoutPath=List("logout"))

kubukoz commented 3 years ago

Yeah, that would probably work best