code: public URI getLoginRequestURIForContext(Context ctx) {
  		if (!(ctx.getAuthenticationMethod() instanceof FormBasedAuthenticationMethod))
  			return null;
  		FormBasedAuthenticationMethod method = (FormBasedAuthenticationMethod) ctx.getAuthenticationMethod();
  		try {
  			return new URI(method.getLoginRequestURL(), false);
  		} catch (URIException | NullPointerException e) {
  			e.printStackTrace();
  			return null;
  		}
  	}
docs: Gets the URI for the login request that corresponds to a given context, if any.
  
  @param ctx the context
  @return the login request uri for context, or <code>null</code>, if the context does not have
  a 'login request' configured