Giter Club home page Giter Club logo

Comments (6)

logston avatar logston commented on August 22, 2024

Hmm, did you set AUTHENTICATION_BACKENDS?

https://github.com/15five/django-scim2/blob/master/demo/root/settings.py#L58-L63

from django-scim2.

Katert avatar Katert commented on August 22, 2024

Hmm, did you set AUTHENTICATION_BACKENDS?

https://github.com/15five/django-scim2/blob/master/demo/root/settings.py#L58-L63

I hadn't added that yet. I just did, removed cookies but still receive a 401 - Unauthorized. I'm sure the Bearer token I'm using is still valid.

from django-scim2.

logston avatar logston commented on August 22, 2024

Are you sure you're pointed at the right URL; including trailing slashes, that sort of thing? And your URL routing is updated?

https://github.com/15five/django-scim2/blob/master/src/django_scim/middleware.py#L46-L56

from django-scim2.

Katert avatar Katert commented on August 22, 2024

Are you sure you're pointed at the right URL; including trailing slashes, that sort of thing? And your URL routing is updated?

https://github.com/15five/django-scim2/blob/master/src/django_scim/middleware.py#L46-L56

Yes pretty sure. This is the urls.py from the root folder in my project:

`from django.contrib import admin
from django.urls import path, include

urlpatterns = [
path('api/admin/', admin.site.urls),
path('api/', include('api.urls')),
path('api/scim/v2/', include('django_scim.urls', namespace='scim')),
path('api/o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
path('api/users/', include('users.urls'))
]
`

I have noticed that when I disable SCIMAuthCheckMiddleware and the Cookie-header, I receive a 404 - Not found because it tries to redirect me to the login page in Postman when I try to perform a POST-request, even when I provide the request with a Bearer token. The request URL changes from /api/scim/v2/Users to /api/scim/v2/api/admin/login/?next=/api/scim/v2/Users so the 404 makes sense because it doesn't exist, but I don't get this behaviour with my non-SCIM endpoints.

Somehow requests send to the SCIM-endpoints ignore the Authorization-header, I think?

from django-scim2.

Katert avatar Katert commented on August 22, 2024

I have managed to solve my issue. I needed to add OAuth2 Token Middleware to my MIDDLEWARE_CLASSES ( 'oauth2_provider.middleware.OAuth2TokenMiddleware'), which solved the problem. I can make requests now with a bearer token to the SCIM endpoints.

from django-scim2.

behconsci avatar behconsci commented on August 22, 2024

@Katert which cookie header are you talking about? I am having the same issue but can't solve it with the steps you have.

I am testing with Okta:
image

from django-scim2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.