CAS Integration with angular apps

57 views
Skip to first unread message

Raghavan TV

unread,
Jun 20, 2020, 2:00:05 AM6/20/20
to cas-...@apereo.org
Hi,

We were able to integrate our J2EE app with CAS -> SAML integration
The SAML server is an external server.
However we are not able to achieve the same in angular.

Any documentation or reference blogs for angular integration is much appreciated

Thanks
Raghav

Virus-free. www.avg.com

Adrian Gonzalez

unread,
Jun 20, 2020, 5:36:16 AM6/20/20
to cas-...@apereo.org
Hello Raghav,

We're using CAS with angular apps with OIDC implicit flow protocol, not SAML.

If you want to activate OIDC protocol in CAS, check this link (you'll need at least CAS 6+ or CAS 6.1+, I don't remember exactly):

On angular side, we're using oidc client js library, it works fine with CAS (I had some glitches with silent refresh and didn't looked at globout logout yet)

This link shows you how to use this lib from an angular app

You have other angular samples on the oidc client js wiki page.

Of course you have other options than using OIDC implicit flow, i.e. :
a - using cookie based session between your angular app and the backend and the backend doing the authentication stuff (i.e. via OIDC authorization flow, or something else - didn't use SAML in this scenario, so I cannot say if it works even if I think yes)
b - same as a but with oidc being taken care on the http server side (i.e. via https://github.com/zmartzone/lua-resty-openidc)
c and + - and surely others

Cheers,
Adrian

P.S. here are some sample service json file that work for us (when test the angular app from a local dev machine) :

{
  "@class": "org.apereo.cas.services.OidcRegisteredService",
  "clientId": "my-app-local",
  "clientSecret": "my-app-secret",
  "serviceId": "http://localhost:4200/.+",
  "signIdToken": true,
  "implicit": true,
  "name": "oidc-my-app-app-local",
  "id": 51,
  "evaluationOrder": 100,
  "bypassApprovalPrompt": true,
  "attributeReleasePolicy": {
    "@class": "org.apereo.cas.services.ReturnAllAttributeReleasePolicy"
  },
  "scopes": ["java.util.HashSet",
    [ "openid","profile","email" ]
  ]
}



--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/CADNy93rBoRot%3Dqc8zx4LEOvx2OSC-HHHiyK%2BeR3uAV%2B0dsbWhw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages