# Unable to access api using a token unless already logged in via UI

**URL:** <https://community.jenkins.io/t/unable-to-access-api-using-a-token-unless-already-logged-in-via-ui/27192>\
**Category:** Community\
**Created:** [February 19, 2025, 4:58pm UTC](https://community.jenkins.io/t/unable-to-access-api-using-a-token-unless-already-logged-in-via-ui/27192 "2025-02-19T16:58:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![varied\_sauce](https://avatars.discourse-cdn.com/v4/letter/v/c37758/32.png) [@varied\_sauce](https://community.jenkins.io/u/varied_sauce)\
**Post date:** [February 19, 2025, 4:58pm UTC](https://community.jenkins.io/t/unable-to-access-api-using-a-token-unless-already-logged-in-via-ui/27192/1 "2025-02-19T16:58:42Z")

</div>

Hi

I’ve just updated to Jenkins v2.492.1 and OpenID Connect Auth v4.457.v8d7c72676cfe.

The problem that I’m experiencing is attempting to retrieve job details via the API. If I’m logged into the Jenkins UI, then fine, I can retrieve details of jobs via the API, but if I logout and attempt the same I see this:

`\> GET /job/location/job/job-folder/job/job\_name/api/json?depth=0 HTTP/2

> Host: [jenkins-host.somewhere.com](http://jenkins-host.somewhere.com)  
> authorization: Basic someencryptedstring  
> user-agent: curl/7.68.0  
> accept: _/_

- Connection state changed (MAX\_CONCURRENT\_STREAMS == 128)!  
\< HTTP/2 302  
\< date: Wed, 19 Feb 2025 16:42:04 GMT  
\< content-length: 0  
\< server: Jetty(12.0.16)  
\< vary: Accept-Encoding  
\< x-content-type-options: nosniff  
\< location: /job/location/job/job-folder/job/some\_job\_name/api/securityRealm/commenceLogin`

This was working as expected before the upgrade and now my job monitoring is broken.

Thanks for any help in advance

---

<div class="post-metadata">

**Author:** ![varied\_sauce](https://avatars.discourse-cdn.com/v4/letter/v/c37758/32.png) [@varied\_sauce](https://community.jenkins.io/u/varied_sauce)\
**Post date:** [February 20, 2025, 10:28am UTC](https://community.jenkins.io/t/unable-to-access-api-using-a-token-unless-already-logged-in-via-ui/27192/2 "2025-02-20T10:28:03Z")

</div>

Found the issue in the cold light of the morning.

Manage Jenkins → Security → Expand Security Configuration → Allow access using a Jenkins API token without an OIDC Session

---

<div class="post-metadata">

**Author:** ![guilcy](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/guilcy/32/11793_2.png) [@guilcy](https://community.jenkins.io/u/guilcy)\
**Post date:** [October 20, 2025, 1:32pm UTC](https://community.jenkins.io/t/unable-to-access-api-using-a-token-unless-already-logged-in-via-ui/27192/3 "2025-10-20T13:32:09Z")

</div>

Path is slightly misleading but you save my day 🙂  
Manage Jenkins → Security → Security Realm → Security Configuration → Allow access using a Jenkins API token without an OIDC Session
