Question

I want to configure a custom port for the redirect URL in the Google Developer Console for the class of 'Installed Apps'.

Following the instructions in https://developers.google.com/accounts/docs/OAuth2InstalledApp , it turns out that this should be possible:

redirect_uri=http://localhost:9004&

Going to the Console ("console.developers.google.com"), "Credentials", and "Create New Client Id", I cannot find the field, where to enter a custom port number. Does anyone know how to do this?

Thanks!

Was it helpful?

Solution

In fact, The document you've read has answered you question:

When you create a client ID in the Google Developers Console, two redirect_uris are created for you: urn:ietf:wg:oauth:2.0:oob and http://localhost. The value your application uses determines how the authorization code is returned to your application.

http://localhost signals to the Google Authorization Server that the authorization code should be returned as a query string parameter to the web server on the client. You may specify a port number without changing the Google Developers Console configuration.

OTHER TIPS

I tried this idea and it works. Give consecutive ports or probable ports in credentials as

**Redirect URIs**
http://localhost:55738/YoutubeVideoList.aspx
http://localhost:8080/YoutubeVideoList.aspx
http://localhost:8081/YoutubeVideoList.aspx
http://localhost:8082/YoutubeVideoList.aspx
http://localhost:8083/YoutubeVideoList.aspx
http://localhost:8084/YoutubeVideoList.aspx

and don't forget to give correct redirectURI with port(anyone above) while calling the authentication process.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top