return u;
}
public static Result handleAuthentication(final String provider,
final Context context, final Object payload) {
final AuthProvider ap = getProvider(provider);
if (ap == null) {
// Provider wasn't found and/or user was fooling with our stuff -
// tell him off:
return Controller.notFound(Messages.get(
"playauthenticate.core.exception.provider_not_found",
provider));
}
try {
final Object o = ap.authenticate(context, payload);
if (o instanceof String) {
return Controller.redirect((String) o);
} else if (o instanceof Result) {
return (Result) o;
} else if (o instanceof AuthUser) {