Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAML Users can't access the API (401) #765

Open
MrBanana05 opened this issue Nov 10, 2024 · 0 comments
Open

SAML Users can't access the API (401) #765

MrBanana05 opened this issue Nov 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@MrBanana05
Copy link

MrBanana05 commented Nov 10, 2024

Describe the bug
Trying to access the API with an API Token created by an SAML user results into an error and a 401 response code along with an error description of "saml.error.cannot_login_saml_user_locally". This has been confirmed by multiple users, on multiple devices, using multiple different tokens and programs (Postman, the embedded /api/docs page, curl, ...). "Normal" users can access the API without any problems.

To Reproduce
Steps to reproduce the behavior:

  1. Configure SAML SSO as described in the docs.
  2. Login using SSO and create an API token.
  3. Try to access some API endpoint like /api/info -> 401

Expected behavior
It is possible to use the API as a SAML user

Logs

curl -v 'https://partdb.example.com/api/info' -H 'Authorization: Bearer tcp_[...]'

< HTTP/2 401
< server: nginx/1.27.2
< date: Sun, 10 Nov 2024 15:29:05 GMT
< content-type: application/ld+json
< content-length: 0
< www-authenticate: Bearer realm="api",error="invalid_token",error_description="saml.error.cannot_login_saml_user_locally"
< cache-control: max-age=0, must-revalidate, private
< x-robots-tag: noindex
< x-content-type-options: nosniff
< referrer-policy: no-referrer, strict-origin-when-cross-origin
< x-frame-options: SAMEORIGIN
< content-security-policy: default-src 'self'; block-all-mixed-content; frame-src 'self' data:; img-src * data:; object-src 'self' data:; style-src 'self' 'unsafe-inline' data:; report-uri /csp/report
< x-content-security-policy: default-src 'self'; block-all-mixed-content; frame-src 'self' data:; img-src * data:; object-src 'self' data:; style-src 'self' 'unsafe-inline' data:; report-uri /csp/report
< x-xss-protection: 1; mode=block
< expires: Sun, 10 Nov 2024 15:29:05 GMT
< set-cookie: REMEMBERME=deleted; expires=Sat, 11 Nov 2023 15:29:04 GMT; Max-Age=0; path=/; secure; httponly; samesite=lax
< vary: Authorization
< strict-transport-security: max-age=31536000
<
* Connection #0 to host partdb.example.com left intact

Server Side

  • Part-DB Version: 1.14.4 running in Docker
  • Database Server MariaDB

Desktop (please complete the following information):

  • OS: Windows 10 / 11

  • Browser: Edge

  • Version latest

  • OS: Ubuntu (WSL)

  • Browser: curl

@MrBanana05 MrBanana05 added the bug Something isn't working label Nov 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant