Parsing TokenRequest as IdP
I'm trying to use this library to implement OpenID Connect identity provider. Is there any way to parse TokenRequest from HttpServletRequest?
In current version (5.62) TokenRequest has only one static parse method which takes HTTPRequest as a parameter, but HTTPRequest itself has only one constructor. I've seen in older versions (for example 4.13) that HTTPRequest had constructor accepting HttpServletRequest, so you could do
TokenRequest.parse(new HTTPRequest(myHttpServletRequest))
Right now I don't see a way to parse TokenRequest as an IdP. Only way is to manually construct HTTPRequest, is this what is recommended now?
Actually same problem exists with AuthenticationRequest although I can parse AuthenticationRequest using constructor which accepts URL parameters as a Map.
In conclusion, what is your recommended way to use TokenRequest when implementing IdP. I did not find any relevant examples.
Comments (4)
-
-
reporter Thank you for the quick response, this is really helpful!
-
reporter - changed status to resolved
-
Thanks Vedran!
- Log in to comment
You can use
com.nimbusds.oauth2.sdk.http.ServletUtils#createHTTPRequest
which will createHTTPRequest
fromHttpServletRequest
for you.Similary, there is
com.nimbusds.oauth2.sdk.http.ServletUtils#applyHTTPResponse
to applyHTTPResponse
toHttpServletResponse
.