-
Notifications
You must be signed in to change notification settings - Fork 59
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
Jenkins API not accessible(403 Forbidden error) with access token generated from azure ad #573
Comments
I think you need Graph API permission for the API to work. |
@timja Do I need to set graph api permission to the app registration which is using in security relam of Jenkins. |
|
I've enabled the entra id permission. Still I'm getting 403 error. |
can you talk me through step by step what you've got setup? |
jenkins:
securityRealm:
azureSecurityRealm:
clientId: ''
clientSecret: ''
tenant: ''
cacheduration: 0
fromrequest: true
authorizationStrategy:
projectMatrix:
entries:
- group:
name: <object-id>
permissions:
- Overall/Administer
- user:
name: <object-id>
permissions:
- Overall/Administer
api_response = requests.get(url, headers=headers, verify=False) |
The Jenkins API uses a Jenkins API token and not a Microsoft access token. Go to the Users profile in Jenkins and generate an API token |
Jenkins and plugins versions report
Environment
What Operating System are you using (both controller, and any agents involved in the problem)?
docker jenkins
Reproduction steps
We're using azure ad app as security relam for our jenkins.Using the azure ad plugin through browser we're able to access the jenkins without any issue(We're not using graph api permission, instead our azure ad app assigned group configured via matrix authorization strategy). Now we need to call the jenkins api,for this we're having a technical account in entra and we're able to create access token for this user.But when we're using this access token for the jenkins api request we're getting 'Error accessing the API: 403 Client Error: Forbidden'.
Expected Results
Jenkins api access with azure ad access token
Actual Results
Error accessing the API: 403 Client Error: Forbidden
Anything else?
No response
Are you interested in contributing a fix?
No response
The text was updated successfully, but these errors were encountered: