Message Security Layer (MSL)

com.netflix.msl.userauth
Class EmailPasswordAuthenticationFactory

java.lang.Object
  extended by com.netflix.msl.userauth.UserAuthenticationFactory
      extended by com.netflix.msl.userauth.EmailPasswordAuthenticationFactory

public class EmailPasswordAuthenticationFactory
extends UserAuthenticationFactory

Email/password-based user authentication factory.


Field Summary
private  AuthenticationUtils authutils
          Authentication utilities.
private  EmailPasswordStore store
          Email/password store.
 
Constructor Summary
EmailPasswordAuthenticationFactory(EmailPasswordStore store, AuthenticationUtils authutils)
          Construct a new email/password-based user authentication factory.
 
Method Summary
 MslUser authenticate(MslContext ctx, String identity, UserAuthenticationData data, UserIdToken userIdToken)
          Authenticate the user using the provided authentication data.
 UserAuthenticationData createData(MslContext ctx, MasterToken masterToken, JSONObject userAuthJO)
          Construct a new user authentication data instance from the provided JSON.
 
Methods inherited from class com.netflix.msl.userauth.UserAuthenticationFactory
getScheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

store

private final EmailPasswordStore store
Email/password store.


authutils

private final AuthenticationUtils authutils
Authentication utilities.

Constructor Detail

EmailPasswordAuthenticationFactory

public EmailPasswordAuthenticationFactory(EmailPasswordStore store,
                                          AuthenticationUtils authutils)
Construct a new email/password-based user authentication factory.

Parameters:
store - email/password store.
authutils - authentication utilities.
Method Detail

createData

public UserAuthenticationData createData(MslContext ctx,
                                         MasterToken masterToken,
                                         JSONObject userAuthJO)
                                  throws MslEncodingException
Description copied from class: UserAuthenticationFactory

Construct a new user authentication data instance from the provided JSON.

A master token may be required for certain user authentication schemes.

Specified by:
createData in class UserAuthenticationFactory
Parameters:
ctx - MSL context.
masterToken - the entity master token. May be null.
userAuthJO - the JSON object.
Returns:
the user authentication data.
Throws:
MslEncodingException - if there is an error parsing the JSON.

authenticate

public MslUser authenticate(MslContext ctx,
                            String identity,
                            UserAuthenticationData data,
                            UserIdToken userIdToken)
                     throws MslUserAuthException
Description copied from class: UserAuthenticationFactory

Authenticate the user using the provided authentication data.

If a user ID token is provided then also validate the authenticated user against the provided user ID token. This is typically a check to ensure the user identities are equal but not always. The returned user must be the user identified by the user ID token.

Specified by:
authenticate in class UserAuthenticationFactory
Parameters:
ctx - MSL context.
identity - the entity identity.
data - user authentication data.
userIdToken - user ID token. May be null.
Returns:
the MSL user.
Throws:
MslUserAuthException - if there is an error authenticating the user or if the user authentication data and user ID token identities do not match.

Message Security Layer (MSL)

Copyright © 2014 Netflix, Inc. All Rights Reserved.