Forum Discussion
F5 SSO - OAuth with SAML - how to preserve the original protect URL
Hi
So I have
login -> This is my login server - I have APM protecting it
auth -> this is my oauth server it talks to login to get login its a saml call
Lets say I have
https://uat/<some protected URL>, that I use a OAuth claim to protect it.
So when i go to https://uat/<some protected URL> I get
redirect to /my.policy
then redirect to auth/oauth url
redirect to auth/my.policy
redirect to login/saml end point
redirect to /my.policy
redirect to /my.policy the login process
redirect to auth/sam return end point
redirect to https://uat/Oauth return point
redirect back to https://uat/<some protected URL>
When it works its okay, but what happens with a bad password or if a user takes to long to login and has to start a new login session any break from normal means that user ends up on https://login/
I have noticed on other SSO work flows - the originating url is in the url passed around - that doesn't happen on F5
I checked the landing on the inital entry to https://auth and the browser doesn't even send the referrer url ...
How do poeple cope with this. Note my apm session are on different F5, so I can't share behind the scene variables !
I admit I do not follow the text as the way you have written it is not very clear at least for me and maybe a picture can help. About sharing session variables can't you insert a session variable an an HTTP header between the F5 devices?
https://support.f5.com/csp/article/K74392192
Also for Oauth just you can use F5 Oauth SSO in "Passthrough" with a JWT token if possible and I think you are not using the F5 devices as Authorization servers and the first f5 APM is Oauth Client/Resource Server then you can make the second F5 with the SAML just resource server and use the info in the token.
https://support.f5.com/csp/article/K42333110
If I got it wrong and the F5 APM is authorization server with claims and JWT Access token you can share info like session variables between the F5 APM AS and the F5 that is Client/Resource server.
If the customer first accesses the first F5 APM oauth device and then the customer accesses the second F5 SAML device with Browser URL redirection you may need to share the session varibles by inserting them in a cookie and then reading from them.
https://clouddocs.f5.com/api/irules/HTTP__cookie.html
https://community.f5.com/t5/technical-forum/assign-cookie-value-to-apm-custom-variable/td-p/292298
Still why you are using Oauth and SAML is strange as Oauth can do anything SAML can do but better with the authorization codes that Oauth uses and for now there is no way to exchange SAML token for an Oauth or vice versa or to use the same token for SAML and Oauth to make life easier 😀
- AlexS_ybCirrocumulus
Hi
Thanks for the input, see if i can try again
https://uat/some/protected/url << APM policy that use oauth client - client/resource
If I don't have a APM session the first response is a 302 to /my.policy
I don't get to run any code - how do I insert a cookie at this stage don't think i can ?
https://uat/my.policy does the redirect to https://auth/someOAuth URL (<< this is the oauth server ) it doesn't know what the original URL was.
About the cookie it is in the links I shared with you that you can take a look at 🙂
Stange from what I have seen after you are returned from the Azure AD you get the url you tried to open. The issue you mentioned I have only when playing for example with the https://petstore.swagger.io/ as a pool member test app as to when I do not send a specific correct request the F5 APM just can't fetch the page. The issue was resolved when I attached URI rewrite profile so that when I send the http traffic to the pool members to change the URI to the real one that that the pool members use so I do not see this issue as it is normal when F5 can't resolve the HTTP request will the backend servers to give you a hint like in my case it was""" xxxx/oauth/login.jsp """ and the below message.
Outside of that it could be a bug so I am on 16.1.3.2 so upgrade to it or you may try URI redirec in the policy as the your landing URI is saved to variable session.server.landinguri , so you may to use something like the link below or an iRule as given in the next Links to "get" the session variable and then to use it for an redirect event.
https://community.f5.com/t5/technical-forum/landing-uri-irule-http-redirection/td-p/34919
https://clouddocs.f5.com/api/irules/ACCESS_POLICY_COMPLETED.html
https://clouddocs.f5.com/api/irules/ACCESS__session.html
That are all my ideas.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com