Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 694
Ranvijay Sachan Avatar asked Dec 06 '16 08:12

Ranvijay Sachan


2 Answers

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?

like image 131
Ranvijay Sachan Avatar answered Oct 30 '22 16:10

Ranvijay Sachan


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

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

like image 40
Rahil Avatar answered Oct 30 '22 16:10

Rahil