aws-s3-oauth2-okta
aws-s3-oauth2-okta copied to clipboard
Okta doesn't redirect to the originating request
Hey @GuiTeK!
This has been of great help to us as we are trying to deploy a similar infrastructure. The one issue that we are now seeing is that okta won't redirect to the originally requested URL but rather fall under index.html (expected given it's what the lambda handler redirects to when the /login
endpoint is requested).
Have you guys run into this or are you okay with just being dropped in the index.html?
@martofeld did you end up finding a solution to this?
@lachlanatscalapay and @martofeld its not very clear whats the best way to fix this but this is what I did to fix this was to use the state
A source of good information was this https://stackoverflow.com/questions/55524480/should-dynamic-query-parameters-be-present-in-the-redirection-uri-for-an-oauth2 which mentions this
OAuth2.0 has a dedicated authorization request parameter for that purpose, which is "[state](https://www.rfc-editor.org/rfc/rfc6749#section-4.1.1)". The client should use it. The AS will append that state in the parameters of the redirect_uri when it issues the response, so the client will be able to find back this state inside the response.
So I could bubble the original URI through the login process
Hope this helps; let me know if you need any more detail. I needed this process BTW as I'm looking to expose objects in S3 as its not a website