oAuth + localhost

Has anyone successfully used oAuth with product development and a localhost redirect?

If I try to use localhost i get an error message “Redirect URI must be a valid HTTPS URL”

Let me ping someone that might be able to help, @rickkas7 or @ParticleD are you able to assist?

Which API endpoint is giving you that error?

Though I suspect the answer is what the error message says: the page you redirect to must be a on a TLS/SSL encrypted server, and you must specify the page with a valid https://host.domain/path URL.

@kyleg thanks

@rickkas7, I think the issue being that there is no domain when running on localhost:


Can we have this changed to allow localhost redirects? It’s not very convenient to have to deploy an application to a server to develop. Other oAuth providers allow localhost development.

You want some external service to know what your localhost is?
AFAICT the external server you instruct to take localhost would probably see local as where it is, not where you are.

What is locality? One of the big puzzles in phyics too :wink:

@ScruffR There is no explicit declaration on what localhost is, where it is etc.

The pattern here is to create an application that makes a request to a server for authentication. If authenticated, that server then redirects the browser to a url if the authentication is successful. Localhost as a url is ambiguous.

Allowing localhost redirects is a common pattern for this type of application development (see https://developer.github.com/apps/building-oauth-apps/creating-an-oauth-app/ for example).

I see now. The best way to submit a feature request of this kind is by creating a Github issue in the cloud repository:

Including the description of where the check is being done and/or the screenshot above would be helpful.

1 Like

thanks @rickkas7, will do!

See https://github.com/particle-iot/cloud/issues/43