Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat]: next-drupal-starter - OpenID User Authentication Use Case #234

Open
backlineint opened this issue Aug 26, 2022 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@backlineint
Copy link
Contributor

backlineint commented Aug 26, 2022

Describe the problem

This starter kit currently handles authentication and authorization from the perspective of a machine user that sources data from Drupal. It would be desirable to demonstrate an example for user authentication as well - a user can authenticate via a login form and as a result gains access to specific resources based on their Drupal account.

Describe the proposed solution

Provide an OpenID based user authentication option.

Drupal:
Assumes that Simple oAuth and OpenID Connect are installed.

Next:
Using NextAuth

High level flow:

  • User authenticates via next-auth / OpenID provider
  • This information is used to authenticate with Drupal
    ** OpenID connect will create a Drupal account the first time a user authenticates if it does not exist. What I'm not clear on is if this will happen when accounts are created via API based registration requests and if the next-auth token provides enough information to make SSO with Drupal possible.
    ** If OpenID can't create accounts via API requests, this step instead would have to try to authenticate or check for the existence of a Drupal account (as the machine user,) and if the account doesn't exist, create an account.
  • A user specific Drupal State store is created for that user. All user specific requests are made through that store.

Drupal State:

Alternatives considered

There are many other auth methods that could satisfy this, but this approach has the benefit of taking advantage of Drupal's simple oAuth Ecosystem.

Importance

It would make my life easier

Additional Information

No response

@backlineint backlineint added the enhancement New feature or request label Aug 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant