SAML with ADFS for angularjs+java+jetty webapp

2019-06-11 08:56发布

问题:

I am working on a webapp, the Front-end is implemented in AngularJS which talks to back-end server by invoking REST API. The back-end is Java REST Server implemented using reslet framework deployed in Jetty.

Currently, when a user logs into a web app, a REST API is invoked which then goes to the Java REST server. The server then authenticates the user.

I want to implement SSO using SAML. So when a corporate user tries to login to the app, the user must be redirected to ADFS. If the user is successfully authenticated he must be allowed to login to the app.

I want to know how do I start? I have seen sam2-js library, however it seems to be for NodeJS based server. I am not quite sure if it can be used with AngularJS on frontend.

回答1:

SSO with SAML involves browser redirects so the flow is between angular and ADFS.

There's no Java backend.

So Jetty is irrelevant.

SSO has nothing to do with REST. They are two different flows handled in two different ways.

SAML is not a suitable SSO protocol for angular. That's why you can't find any examples.

You need to use OpenID Connect with ADFS 4.0. ADAL is the way to go.