Skip to content

Commit

Permalink
fix(jans-auth-server): fix npe
Browse files Browse the repository at this point in the history
npe when checking for client config option defaultpromptlogin

Signed-off-by: Javier Rojas Blum <javier.rojas.blum@gmail.com>
  • Loading branch information
qbert2k committed Mar 7, 2022
1 parent 452ce0f commit e6debb2
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
* Implementation for request authorization through REST web services.
*
* @author Javier Rojas Blum
* @version March 2, 2022
* @version March 7, 2022
*/
@Path("/")
public class AuthorizeRestWebServiceImpl implements AuthorizeRestWebService {
Expand Down Expand Up @@ -601,8 +601,9 @@ private Response requestAuthorization(
}
}

if (identity.getSessionId().getState() == SessionIdState.AUTHENTICATED
if (identity != null && identity.getSessionId() != null && identity.getSessionId().getState() == SessionIdState.AUTHENTICATED
&& client != null && Boolean.TRUE.equals(client.getAttributes().getDefaultPromptLogin())
&& identity.getSessionId().getAuthenticationTime() != null
&& new Date().getTime() - identity.getSessionId().getAuthenticationTime().getTime() > 200) {
prompts.add(Prompt.LOGIN);
}
Expand Down

0 comments on commit e6debb2

Please sign in to comment.