How can a custom user service change the login results

34 views
Skip to first unread message

Zakie Mashiah

unread,
Mar 22, 2017, 5:33:55 AM3/22/17
to SecureSocial
We have implemented and used SecuredSocial for some time now. We have additional data on users that we maintain in our DB.
We wrote a custom user service that works well, but we want to add the functionality for controlling users login (e.g. suspending a user for a period of time).
I was wondering what is the right way for the user service to do that? I can see the messages files have different messages like:
  securesocial.login.accessDenied=You denied access to your account. Please grant it to log in.
But not sure how the user service can direct the reply to accessDenied. Simply returning null (yes, Java App) from my implantation of 
  @Override
public Promise<ShadowUser> doSave(BasicProfile profile, SaveMode saveMode)
  results in showing the message:
  securesocial.login.invalidCredentials=The credentials you entered are not valid

Jorge Aliss

unread,
Mar 23, 2017, 3:00:59 PM3/23/17
to SecureSocial
Zakie,

There's no built in support for that now in the module. We could add methods to support that into UserService or add a new service for these cases and use that from the ProviderController to prevent logins.  I imagine you'd expect this blocking to work for all providers, right?

Jorge

Zakie Mashiah

unread,
Mar 24, 2017, 2:44:20 AM3/24/17
to Jorge Aliss, SecureSocial
Hi 
I think the right thing is to be able to block on any provider. Thanks!
Reply all
Reply to author
Forward
0 new messages