3

I am using SAML authentication in my angular app which will be hosted on AWS. I am using angular code as separate project & code is written in different project. I have used Itfoxtec saml library in my webapi. In my project i am calling webapi from angular and flow is like below

  • end users visit website on http://localhost:1010
  • for the test, i call my first webapi which returns me IDP url to redirect to
  • my angular app, route the end user to respective IDP url and IDP server then redirect user to call back URL with SAML response. In my case, i tried to set my call back URL as http://localhost:1010/Auth/AssertionComponenet , which is angular component
  • My idea was to call another webapi to read the SAML response and provide all claim information

But i am getting error when IDP server redirect user to call back url which is angular URL. Error is : Cannot POST /Auth/AssertionComponenet

Any solution to this issue ? I read some post and they said angular cant read post response, so no idea on next step.

If i set call back URL as my webapi URL, will this work and even if worked, how i will be coming back to angular home page after verification of use.

Girish G
  • 93
  • 7

1 Answers1

1

I am afraid it is not possible to pass the POST SAML 2.0 Authn Response through a frontend client lige e.g. Angular. The response need to go directly back to a server based endpoint.

This post is probably helpful: AssertionUrl for AngularJS Application

Anders Revsgaard
  • 3,636
  • 1
  • 9
  • 25
  • 1
    Thanks Aders, i read the given post. So you mean, we should set call back to webapi and read the claim. In webapi itself , Option 1 : we should set the cookies and then redirect to angular page which will read the cookies for claim information Option 2 : we should create a JWT token and redirect to angular URL which will read the token and use information. I am trying to achieve SSO using saml so i will need end user information like their eomployee id , line manager which is coming from IDP via claim. – Girish G Jun 09 '21 at 17:40
  • Yes, something like that. – Anders Revsgaard Jun 10 '21 at 03:54