Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
  • Community
  • Q&A
  • Jira
  • Questions
  • Forge External Auth Provider (Keycloak): hasCredentials() returns false after successful authenticat

Forge External Auth Provider (Keycloak): hasCredentials() returns false after successful authenticat

Akshat Patel
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 14, 2025

Issue Summary:
We are experiencing an issue with Forge's External Auth Provider integration using Keycloak. After a successful authentication, `keycloak.hasCredentials()` incorrectly returns `false` on the first attempt, but returns `true` on subsequent requests.

Environment:
- Forge App using External Auth Provider
- Auth Provider: Keycloak
- Runtime: Node.js 20.x
- Forge API: @Forge/api

Code Implementation:
const keycloak = await api.asUser().withProvider("keycloak", "custom-backend");
if (!(await keycloak.hasCredentials(["email"]))) {
await keycloak.requestCredentials();
}

1 answer

0 votes
Tomislav Tobijas
Community Champion
November 16, 2025

Hey @Akshat Patel ,

Probably won't be much of a help here, but if you don't get any response, I'd suggest asking this question in the Developer Community. (it's a separate community from this one)

2025-11-16_10-21-01.png

You'll probably get some good insights on how to resolve this from the dev folks there.

Cheers,
Tobi

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events