Provide static constants for Oauth error codes
Hi,
currently error codes in com.nimbusds.oauth2.sdk.http.HTTPResponse.OAuth2Error
are hardcoded strings which does not make it possible to reuse them where we as a library user have a case where compile time constant is needed (e.g. switch case, annotation attributes). It would be nice if they could be provided like public static final variables inside OAuth2Error class. If this proposition is acceptable, I can provide PR.
Comments (7)
-
-
It looks like you meant the `ErrorObject` constants declared in
OAuth2Error
.Yes, sure, send us a PR and we’ll review it and merge it if all is well. If there are modifications that need to be captured in a test, please include such tests.
-
reporter Yes, ErrorObject instances that use String literals for error codes (e.g.
"invalid_request”
). Thanks for the quick response, will do. -
Hi Ivan,
Just checking if you managed to progress the PR. You can also post a patch here.
-
reporter Hello, did some work but I was kind of busy last week, planned to tackle and finish this on Saturday. Is that ok?
-
Thanks!
If all is well it will be released immediately so you can make use of the feature in your project without delay.
-
- changed status to resolved
Update released in version 9.3 (2021-03-29).
Happy coding!
- Log in to comment
Hi Ivan,
Could you post a snippet, the HTTPResponse class has status code ints and doesn’t deal with OAuth error codes?