Custom sign-in page for cognito with username and password sign-in
Question 💬
I am using the cognito provider, and up until now I've been quite happy with the UI that cognito provides. But now I want to implement my own UI for sign-up and sign-in. I'm a little confused by next-auth's support on "sign-in" with respect to a simple username and password sign-in flow.
For "sign-up" it's clear that next-auth doesn't support this, so I implemented sign-up by going directly to the cognito/amplify library. A little messier than I wanted, but no huge problem.. ✅
I then went to implement my custom sign-in page that allows username and password (just like like the cognito provided UI gives, but except within my own UI) but it seems that next-auth doesn't support this either? I can do signIn('cognito') which just forwards to the cognito hosted UI. But I can't see how to do something like signIn('cognito', {'username: 'usr', password: 'pass'}) <- for example?
The documentation for next-auth ( https://next-auth.js.org/configuration/pages#credentials-sign-in ) has a section for credentials sign in - but it's my understanding that if I'm using cognito I don't want or need to setup a credentials provider? or can cognito be used as a credentials provider?
Any and all help and advice is greatly appreciated.
How to reproduce ☕️
Nothing to reproduce really - just looking for advice.
Contributing 🙌🏽
Yes, I am willing to help answer this question in a PR
Duplicate of #2525. See https://github.com/nextauthjs/next-auth/issues/2525#issuecomment-899569064
Hey @balazsorban44 - thanks for pointing that out.
So are you concluding that in response to my question:
custom sign-in page that allows username and password (just like like the cognito provided UI gives, but except within my own UI) but it seems that next-auth doesn't support this either?
That the answer is: no - signIn with username and password is not supported in any way by next-auth? Just want to make 100% sure.
Thanks
It's supported through the Credentials provider https://next-auth.js.org/providers/credentials
Hey Colin, did you manage to implement Cognito as a provider with a custom page login? Thanks
Hey @colin-riddell, @zul-yang, were you able to implement custom page for login and still using Cognito as a provider? Thanks in advance.
For anyone looking for an example, I made this: https://github.com/jamaybyrone/Next-Auth-Custom-Cognito