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 ; } }
Gets the URI for the login request that corresponds to a given context if any .