Ranvijay sachan
Ranvijay sachan

Reputation: 2444

OpenID connect based authentication in Angular.js with (drf oidc) Django rest framework backend

Is there a way to write the logic for both backend and frontend?

In my current flow, We are using Django rest-framework login, now we need to integrate OpenID connect SSO in our project so guide me how we can integrate OpenID connect SSO with Django-rest framework.

Is there a GitHub example? I am looking for a sample code.

Upvotes: 6

Views: 2444

Answers (2)

Ranvijay sachan
Ranvijay sachan

Reputation: 2444

We can use the implicit flow, I added an example of how to use OIDC with a client-side app.

Front end get access token: http://django-oidc-provider.readthedocs.io/en/develop/sections/examples.html#pure-js-client-using-implicit-flow

You also have to validate ID_TOKEN's in backend:

https://openid.net/specs/openid-connect-implicit-1_0.html#IDTokenValidation

Sample code: https://github.com/ranvijay-sachan/django-rest-login-and-social_auth

I have tested with Google open id connect for any SSO provider you can add below code using python social auth:

how can we integrate any SSO provider using python social auth openid connect?

Upvotes: 6

Rahil
Rahil

Reputation: 632

Here it has user angualr Js with django-rest-framework-jwt

https://github.com/rmemon/Angular-JS-django-rest-framework-jwt

Upvotes: 2

Related Questions