if (!hasOpenID) {
throw new NoOpenIdAuthException(
"OpenID endpoint is required");
} else {
if(((OpenIDError) t).message() != null) {
throw new AuthException(((OpenIDError) t).message());
} else {
throw new AuthException("Bad response from OpenID provider");
}
}
} else {
throw new AuthException(t.getMessage());
}
}
} else {
final Map<String, String> required = getAttributes(SettingKeys.ATTRIBUTES_REQUIRED);
final Map<String, String> optional = getAttributes(SettingKeys.ATTRIBUTES_OPTIONAL);
try {
final Promise<String> pr = OpenID.redirectURL(
payload.toString(), getRedirectUrl(context.request()),
required, optional);
return pr.get(getTimeout());
} catch (final Throwable t) {
if (t instanceof java.net.ConnectException) {
throw new OpenIdConnectException(t.getMessage());
} else {
throw new AuthException(t.getMessage());
}
}
}
}