This repository has been archived by the owner on Sep 12, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The providers do handle the
Identity
not any more. They return only theLoginInfo
and for the social providers theSocialProfile
which contains theLoginInfo
and the profile data returned by the provider. I followed your suggestions for theIdentity
trait. It contains only theLoginInfo
. The authentication information (secret tokens, password, ...) will only be handled by the providers. I have created an AuthInfoService` which can persist this data into the backing store.With the current implementation the authentication flow should be as follow.
Social Providers:
If the user authenticates the first time, the social provider implementation stores the authentication info for the linked
LoginInfo
into the backing store and returns theSocialProfile
. Now the controller should create a newIdentity
. Maybe only from the data provided by the social provider or with additional data(IP-Address, UserAgent, Lang, ...). It the user authenticates again at a later time, then the provider updates the authentication info for the linkedLoginInfo
and returns also theSocialProfile
. Now the identity can be updated with the returned profile data and theLoginInfo
can be stored in the authenticator cookie.Credentials Provider:
During registration the registration controller stores the authentication info and the created
Identity
in the backing store. Now if the user tries to authenticate with its credentials, the provider checks if the stored authentication info matches with the credentials. If so the provider returns only theLoginInfo
which can then be stored in the authenticator cookie.