You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have use case where I wan't to allow sign in with OAuth2 for existing application users, but I don't want to allow new registrations (the registration process happens manually by an administrator).
However, I'm not sure how I can achieve that. I've looked at the code of the OAuth2 module and I noticed that there is no event fired before attempting to save the user into the OAuth2ServerStorer:
The only solution I see is to implement my own OAuth2 module that fires an event prior to saving the user. In the event handler I'll check whether the user exists, and if it does not, I'll stop the execution of the OAuth2 module (effectively skip saving user into the store).
Other option I see is to have a custom OAuth2 module that handles specific error returned from the OAuth2ServerStorer.SaveOAuth2 and again skip persisting the user.
I like the first approach better, but still I wanted to hear whether this is something that anyone else has considered and if it will eventually fit into authboss itself.
Best,
Ivan
The text was updated successfully, but these errors were encountered:
Hi,
First of all thanks for your awesome work!
I have use case where I wan't to allow sign in with OAuth2 for existing application users, but I don't want to allow new registrations (the registration process happens manually by an administrator).
However, I'm not sure how I can achieve that. I've looked at the code of the OAuth2 module and I noticed that there is no event fired before attempting to save the user into the OAuth2ServerStorer:
authboss/oauth2/oauth2.go
Lines 235 to 249 in e74112f
The only solution I see is to implement my own OAuth2 module that fires an event prior to saving the user. In the event handler I'll check whether the user exists, and if it does not, I'll stop the execution of the OAuth2 module (effectively skip saving user into the store).
Other option I see is to have a custom OAuth2 module that handles specific error returned from the OAuth2ServerStorer.SaveOAuth2 and again skip persisting the user.
I like the first approach better, but still I wanted to hear whether this is something that anyone else has considered and if it will eventually fit into authboss itself.
Best,
Ivan
The text was updated successfully, but these errors were encountered: