1

I am implementing custom external identity provider and to do this I need to implement ExternalIdentityProvider class from jackrabbit.

http://jackrabbit.apache.org/oak/docs/security/authentication/externalloginmodule.html

In normal case you would need to pass j_username and j_password and you can get these from values SimpleCredentials object

My question is that since I need to pass additional form parameter say for instance linkedin ID in my case, how do I achieve that?

    @Component(
            policy = ConfigurationPolicy.REQUIRE
    )
    @Service
    public class RDBMSIdentityProvider implements ExternalIdentityProvider {

    @Override
    public ExternalUser authenticate(Credentials credentials)
            throws ExternalIdentityException, LoginException {
          //i can get username / password from  credentials object
          //how to get additional parameters from http request object?
    }

Any input is highly appreciated.

Thanks!

Homer
  • 59
  • 2
  • 7

1 Answers1

0

The correct way to handle this is to have a custom AuthenticationHandler which creates an instance of a specific Credentials object with whatever parameters you need in it.

That said, if you are integrating with LinkedIn (and this is in AEM), you would be better served by integrating with the existing OAuth AuthenticationHandler. There is OOTB support for Facebook and Twitter, but the OAuth provider is designed to be pluggable for different OAuth Service Providers.

Justin Edelson
  • 461
  • 3
  • 8