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

Oauth support? #626

Open
fenchu opened this issue Jul 6, 2022 · 0 comments
Open

Oauth support? #626

fenchu opened this issue Jul 6, 2022 · 0 comments

Comments

@fenchu
Copy link

fenchu commented Jul 6, 2022

If rest-api requests get 401, or web requests are forwarded to the login page, I issue an access token via our oauth2 server (keycloak) and inject it as bearer token in the header. This works fine, but it is single threaded and quite slow.

Are there ways in linkchecker to do this?

on 401 responses:

curl -i -H "Content-Type: application/x-www-form-urlencoded" -X POST "https://auth.example.com/auth/realms/<REALM>/protocol/openid-connect/token" -d "grant_type=client_credentials&client_id=<CLIENTID>&client_secret=<CLIENTSECRET>"

this will return an accesstoken in json, I can extract

{"access_token"<MYVERYLONGACCESSTOKEN>","expires_in":300,"refresh_expires_in":0,"token_type":"Bearer","not-before-policy":0,"scope":"scim_write scim_read"}

and then inject it into the requests header:

curl -X POST -H 'Accept: application/scim+json' -H 'Accept-Encoding: gzip, deflate' -H 'Authorization: Bearer <MYVERYLONGACCESSTOKEN>' 
..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants