I'm developing an application where the users have their own URLs, and they need to use Google API - of course with different redirect URIs, like
So first I thought I could simply solve this problem by using wildcards (www.example.com/*/google/login), but it unfortunately doesn't work that way. Then I started to code a simple proxy in Perl, but I'm not sure it would work and we're running out of time. What is the best way to deal with the situation? I thought about adding a new redirect URI to the console from the registration handler, but I didn't find any way the server could do this.
A redirect URI, or reply URL, is the location where the authorization server sends the user once the app has been successfully authorized and granted an authorization code or access token.
The redirect URIs are the endpoints to which the OAuth 2.0 server can send responses. These endpoints must adhere to Google's validation rules. For testing, you can specify URIs that refer to the local machine, such as http://localhost:8080 .
The redirect URL is the endpoint for your application or web page that processes the seller authorization response and manages the seller's OAuth tokens. You need to add this URL to your application using the Developer Dashboard.
Wildcards are not supported in Google OAuth2 redirect URIs. I think your best best is to use a single redirect URI, and pass in the user information in the state parameter. The state parameter is returned to you in response. Then, when you receive the authorization code/tokens, you can lookup the state parameter and handle the response appropriately (e.g., redirect to your user-specific URLs).
This answer has more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With