-1

I've deployed a Python & Django Application in IBM Cloud Foundry and trying to integrate APP-ID for SSO. I received the OIDC provider information from the metadata provided from the APP-ID. But my question is how do I integrate the APP-ID with DJANGO APPLICATION for a Successful integration of SSO?

Here is an example of how flask application, can be used but is there an example or process of how a Django application is done? https://dzone.com/articles/securing-your-python-app-with-openid-connect-oidc-1

For this integration, I tried to use below links for OIDC client in Django App and IBM APP-ID information for integration but no luck.

APP-ID: https://dzone.com/articles/securing-your-python-app-with-openid-connect-oidc-1

OIDC: https://django-oidc-rp.readthedocs.io/en/stable/getting_started.html

2 Answers2

0

The DZone article on the Python app with OIDC refers to this IBM Cloud solution tutorial. The tutorial discusses the use of IBM Cloud App ID for the Python Flask app and provides the code in this GitHub repository. Take a look at how the Flask OIDC module is initialized:

# Configure access to App ID service for the OpenID Connect client
appID_clientinfo=ClientMetadata(client_id=appIDInfo['clientId'],client_secret=appIDInfo['secret'])
appID_config = ProviderConfiguration(issuer=appIDInfo['oauthServerUrl'],client_metadata=appID_clientinfo)

The code uses OIDC discovery for the actual setup. It requires only the clientID and secret as well as the URI. Aren't those exactly the properties you are asked for in the second article you linked to?

data_henrik
  • 16,724
  • 2
  • 28
  • 49
  • Thank you, Does the Flask OIDC package work with Django? all the examples shown are related to flask. – IpV6Python Aug 19 '19 at 15:19
  • The two lines of code are the template for initializing the Django OIDC module. – data_henrik Aug 19 '19 at 15:34
  • But it isn't the same steps for Django. In Django, most of the configurations are in settings.py. Which defines the routing of the app. I'm new to Django and trying to learn as I go If my understanding is wrong.. Please help.. – IpV6Python Aug 19 '19 at 18:36
0

I'm using mozilla-django-oidc. The setup is well documented: https://mozilla-django-oidc.readthedocs.io/en/stable/installation.html#quick-start

It looks quite similar to django-oidc-rp from a quick glance, but mozilla-django-oidc seems to be a bit more active on github and works for me.

C-nit
  • 37
  • 4
  • Thank you, While doing some research online I found AllAuth package. Have you ever tried it? https://github.com/pennersr/django-allauth For the Mozilla package, Is there an Django Example you can provide? – IpV6Python Aug 19 '19 at 15:18
  • Can you please provide an example of how the integration can be done from the APP-ID to Django Application. – IpV6Python Aug 19 '19 at 18:42
  • GitHub has a "Used by" function, maybe you find what you are looking for there. https://github.com/mozilla/mozilla-django-oidc/network/dependents e.g. https://github.com/jredrejo/oidc_test_client – C-nit Sep 26 '19 at 08:53