You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In driver implementation, default configuration will be performed through configureRedirectRequest. At this time, the package @poppinss/oauth-client will add scope to the URL.
exportclassGoogleDriverextendsOauth2Driver<GoogleToken,GoogleScopes>{
...
protectedconfigureRedirectRequest(request: RedirectRequestContract<GoogleScopes>){
...
/** * Define user defined scopes or the default one's */request.scopes(this.config.scopes||['openid','userinfo.email','userinfo.profile'])...}...}
will generate a URL similar to: https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=...&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&response_type=code&state=...&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fforms.currentonly
You can see that 2 scope are included, which will cause errors on some platforms, such as Google.
Solution
Method 1: Explicitly add request.clearScopes() in the Defining scopes section of the document.
Package version
5.0.2
Describe the bug
When using
request.scopes()
orrequest.mergeScopes()
, even if Scopes is not defined in theconfig/ally.ts
file, the wrong URL will be generated.The following code will generate the wrong URL: There will be 2 scope keys on the querystring and cause errors on some platforms.
Cause of the problem
In driver implementation, default configuration will be performed through configureRedirectRequest. At this time, the package
@poppinss/oauth-client
will add scope to the URL.So when using the following code:
will generate a URL similar to:
https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=...&scope=openid+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile&response_type=code&state=...&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fforms.currentonly
You can see that 2 scope are included, which will cause errors on some platforms, such as Google.
Solution
Method 1: Explicitly add
request.clearScopes()
in the Defining scopes section of the document.Method 2: Fix the
scopes()
andmergeScopes()
methods of theredirect_request.ts
file and callthis.clearScopes()
beforethis.param()
.Reproduction repo
No response
The text was updated successfully, but these errors were encountered: