This repository was archived by the owner on Dec 12, 2018. It is now read-only.
This repository was archived by the owner on Dec 12, 2018. It is now read-only.
OauthAuthenticationException#getCode returns an http code rather than Stompath error code #603
Open
Description
OauthAuthenticationException
extends ResourceException
.
ResourceException#getCode()
has a javadoc saying that it returns Stormpath's error codes.
When this code throws an OauthAuthenticationException
:
try {
ServletHttpRequest stormpathHttpRequest = new ServletHttpRequest(httpRequest);
OauthAuthenticationResult result = Applications.oauthRequestAuthenticator(application)
.authenticate(stormpathHttpRequest);
account = result.getAccount();
} catch (ResourceException ex) {
// THIS WILL PRINT OUT 401
System.out.println(ex.getCode());
}
then the code is 401. This code is not Stormpath's error code but http code. We need to investigate if all the errors wrapped with OauthAuthenticationException
are http only. If that is the case then we should just update javadoc for this particular class to clarify that the error codes are http ones.