*/
private void validate() throws MessageException
{
if (! _parameters.hasParameter("auth_policies"))
{
throw new MessageException(
"auth_policies is required in a PAPE response.",
OpenIDException.PAPE_ERROR);
}
String authTime = getAuthTime();
if (authTime != null)
{
try
{
_dateFormat.parse(authTime);
}
catch (ParseException e)
{
throw new MessageException(
"Invalid auth_time in PAPE response: " + authTime,
OpenIDException.PAPE_ERROR, e);
}
}
Iterator it = _parameters.getParameters().iterator();
while (it.hasNext())
{
String paramName = ((Parameter) it.next()).getKey();
if (PAPE_FIELDS.contains(paramName) || paramName.startsWith(PapeMessage.AUTH_LEVEL_NS_PREFIX))
continue;
if ( paramName.startsWith(AUTH_LEVEL_PREFIX) &&
(authLevelAliases.values().contains(paramName.substring(AUTH_LEVEL_PREFIX.length()))))
continue;
throw new MessageException(
"Invalid parameter in PAPE response: " + paramName,
OpenIDException.PAPE_ERROR);
}
}