amazon-archives / amazon-cognito-auth-js

The Amazon Cognito Auth SDK for JavaScript simplifies adding sign-up, sign-in with user profile functionality to web apps.
Apache License 2.0
423 stars 232 forks source link

Is it possible to use and redirect to a non-secure URL before and after login? #166

Closed davestewart closed 5 years ago

davestewart commented 5 years ago

Or do I need to set up SSL on my machine before attempting to develop locally?

marcayne commented 5 years ago

~I don't think it's possible, I set up a local cert to be able to develop locally, it'll take you 10 minutes: https://medium.com/@richardr39/using-angular-cli-to-serve-over-https-locally-70dab07417c8~

Check @chamathsilva answer below!

davestewart commented 5 years ago

@mikiAdSecure - hey, thanks for the link!

I'll check it out now

chamathsilva commented 5 years ago

@davestewart you don't have to set up SSL. Cognito allows redirecting non-secure URL if it is localhost. for example, you can use non-secure URL such as http://localhost:3000, http:localhost:3000/logincallback

davestewart commented 5 years ago

Oh really!? I'll check that out now :)

marcayne commented 5 years ago

Oh, it does seems to be the case with localhost! Thanks a lot @chamathsilva !

davestewart commented 5 years ago

Hmm, I tried that before and I got this:

image

I'm on localhost:8080

davestewart commented 5 years ago

OK, I solved it!

I didn't realise that all the URLs have to match ones already setup in a control panel on AWS.

A back end dev was handling that.

He also didn't realises that you could use http://localhost so everybody's learnt something!

😄