简体   繁体   中英

Shibboleth IDP redirection in an ajax call

We have set up SSO using shibboleth and one of the SP is a reporting tool while another is a java based application.

User is login into Java app (SP2) getting redirected to IDP, after authentication redirected back to SP2.

In the landing page of SP2 ,we have embedded some contents using ajax (CORS) from SP1. Now since user is not yet authenticated against SP1 (cookie of SP1 not yet set) , with ajax connection , its getting redirected to IDP which in turns redirect entire page to SP1 after setting SP1 cookie.

If I use IFRAME everything works fine because the redirection and back redirection happens inside iframe and SP1 cookie gets set also user remains on SP2 landing page.

Has anyone encountered similar issues. As of now I have solved this issue by a hidden iframe. but looking for a permanent solution.

So I have solved this problem using few redirection and its working fine.

Created a redirection in landing page of SP2 to SP1 page say (takeBack.html), In takeBack.html inside SP1 redirected it back to SP2 actual home page.

 <!doctype html> <html> <head> <title>Login</title> </head> <body> <script> var goto = 'http://SP1domain.com/takeBack.html'; window.open(goto, '_self'); </script> </body> </html> 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM