keystonejs / keystone

The most powerful headless CMS for Node.js — built with GraphQL and React
https://keystonejs.com
MIT License
8.98k stars 1.13k forks source link

docs(examples): add custom session with passport #9125

Open iamandrewluca opened 2 months ago

iamandrewluca commented 2 months ago

https://github.com/keystonejs/keystone/assets/1881266/dfc1a65f-13d1-4cbf-84e7-8dd64b3faca7

codesandbox-ci[bot] commented 2 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit de87b5326afedd27086b790973232212e285665c:

Sandbox Source
@keystone-6/sandbox Configuration
dcousens commented 2 months ago

I can't review this this week @iamandrewluca, but this looks amazing! :yellow_heart:

iamandrewluca commented 2 months ago

Great! I will also do a review myself, probably at the end of the week or next week. I Need to make some more adjustments.

borisno2 commented 1 month ago

Nice work @iamandrewluca ! 💙

iamandrewluca commented 1 month ago

@borisno2 @dcousens PR is ready to be reviewed again!

LabLamb commented 1 month ago

Nice! May I ask what is the password set to?

iamandrewluca commented 1 month ago

@LabLamb, what do you mean by that? Trolling? Spam soon?

LabLamb commented 1 month ago

@LabLamb, what do you mean by that? Trolling? Spam soon?

For the native Keystone auth method there is a password, if we use SSO for creating the account, what method is used to craete an password for that the newly created account? Is it a random long string or blank?

iamandrewluca commented 1 month ago

In this case, there is no password. You always log in with SSO. SSO is responsible for user authentication.

This use case can be made to work in combination with both SSO and password. In that case, a random password is generated when the user first logs in with SSO. And later, they can decide to do a "forgot password" and start using username/password instead of SSO.

Even multiple providers can be added to SSO.