question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrading from 0.1.2 --> 1.9.4 and Django 1.11 --> 2.2.25 - MSIS9605 related to OpenID?

See original GitHub issue

Hello, I am working on upgrading Django to version 2.2.X alongside upgrading our Python to 3.8.

These changes mean I can no longer use version 0.1.2 of django-auth-adfs library.

I have implemented all the required changes to upgrade django-auth-adfs to the latest 1.9.4 version.

However, I have hit a bit of a stumbling block with the new open_id connect code that is introduced in the newer versions of this library.

Essentially, now that I have upgraded, I am getting the following error back from the Microsoft Server 2016: MSIS9605%3a+The+client+is+not+allowed+to+access+the+requested+resource.

I have estbalished that if I comment out the following code in the build_authorization_endpoint (config.py) method:

        # if self._mode == "openid_connect":
        #     query["scope"] = "openid"
        #     if (disable_sso is None and settings.DISABLE_SSO) or disable_sso is True:
        #         query["prompt"] = "login"
        #     if force_mfa:
        #         query["amr_values"] = "ngcmfa"

Then the generated authentication URL works fine and I am able to login no problem.

I’m still quite new to ADFS and don’t fully understand how openid_connect works, but my organisation has two ADFS instances, one is the legacy instance which uses Active Directory and the other is the newer one using Azure. We still use the old one and it seems like this openid_connect is related to Azure, so is this plugin wrongly trying to use OpenID when it shouldn’t in our instance?

On ADFS, I already have the permissions configured correctly as I understand and login works fine once I remove “openid” stuff from the URL.

Ideally, I need a way to force the plugin to stop using openid_connect, I understand it is trying to use openid_connect because it has found a valid config on our server and it uses it by default.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
JonasKscommented, Jan 11, 2022

Ye I was passing the preferred_username but it doesn’t seem to exist in the token

This will vary on which token version you configure. FastAPI-Azure-Auth is a much more up2date package, since it’s been written for Azure AD. You can see how you change the token version here.

1reaction
JonasKscommented, Jan 11, 2022

Azure AD -> Application registration -> Token configuration -> sAMAccountName instead of Group ID on Access (or all of them).

bilde

Read more comments on GitHub >

github_iconTop Results From Across the Web

I can not install Django v4.0.2 on my computer
This is what I've got Collecting django==4.0.2 Could not find a version that satisfies the requirement django==4.0.2 (from versions: 1.1.3, ...
Read more >
mozilla-django-oidc 0.3.2 - PyPI
A lightweight authentication and access management library for integration with OpenID Connect enabled authentication services.
Read more >
T_PAAMAYIM_NEKUDOTAYIM Error in Tools/Dashboard.php
Upgrading from 0.1.2 --> 1.9.4 and Django 1.11 --> 2.2.25 - MSIS9605 related to OpenID? 13, 2022-01-10, 2022-08-11. websteps: involve power users in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found