[GH-ISSUE #4012] [bug]: Error when login with Azure AD (Azure Entra) #1415

Open
opened 2026-03-16 20:15:56 +03:00 by kerem · 7 comments
Owner

Originally created by @baoduy on GitHub (Apr 28, 2024).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4012

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

When I do login with Azure AD I got the below error

[Nest] 57 - 04/28/2024, 8:26:12 AM ERROR [ExceptionsHandler] Failed to obtain access token Backend Server | InternalOAuthError: Failed to obtain access token

Steps to reproduce

  1. Goto the page and click login with Micrsoft
  2. After redirected back to backend app then I got the error on the log.

here is my Azure AD Application. Register Manifresh

{
	"id": "878eea34-734d-430b-a7a6-0d04485a43bf",
	"acceptMappedClaims": null,
	"accessTokenAcceptedVersion": null,
	"addIns": [],
	"allowPublicClient": null,
	"appId": "95acfcdb-a8a6-4aae-b3f6-da7e8a24b124",
	"appRoles": [],
	"oauth2AllowUrlPathMatching": false,
	"createdDateTime": "2024-04-28T08:34:52Z",
	"description": null,
	"certification": null,
	"disabledByMicrosoftStatus": null,
	"groupMembershipClaims": null,
	"identifierUris": [],
	"informationalUrls": {
		"termsOfService": null,
		"support": null,
		"privacy": null,
		"marketing": null
	},
	"keyCredentials": [],
	"knownClientApplications": [],
	"logoUrl": null,
	"logoutUrl": null,
	"name": "dev-hoppscotch",
	"notes": null,
	"oauth2AllowIdTokenImplicitFlow": false,
	"oauth2AllowImplicitFlow": false,
	"oauth2Permissions": [],
	"oauth2RequirePostResponse": false,
	"optionalClaims": null,
	"orgRestrictions": [],
	"parentalControlSettings": {
		"countriesBlockedForMinors": [],
		"legalAgeGroupRule": "Allow"
	},
	"passwordCredentials": [
		{
			"customKeyIdentifier": null,
			"endDate": "2026-04-28T08:35:53.608Z",
			"keyId": "ede10190-61b4-44a8-8104-57be477c8e2d",
			"startDate": "2024-04-28T08:35:53.608Z",
			"value": null,
			"createdOn": "2024-04-28T08:36:13.464369Z",
			"hint": "7.I",
			"displayName": "dev-hoppscotch"
		}
	],
	"preAuthorizedApplications": [],
	"publisherDomain": "ad.drunkcoding.net",
	"replyUrlsWithType": [
		{
			"url": "https://api.dev.local/v1/auth/microsoft/callback",
			"type": "Web"
		}
	],
	"requiredResourceAccess": [
		{
			"resourceAppId": "00000003-0000-0000-c000-000000000000",
			"resourceAccess": [
				{
					"id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",
					"type": "Scope"
				}
			]
		}
	],
	"samlMetadataUrl": null,
	"signInUrl": null,
	"signInAudience": "AzureADMyOrg",
	"tags": [],
	"tokenEncryptionKeyId": null
}

Environment

Release

Version

Self-hosted

Originally created by @baoduy on GitHub (Apr 28, 2024). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/4012 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior When I do login with Azure AD I got the below error `[Nest] 57 - 04/28/2024, 8:26:12 AM ERROR [ExceptionsHandler] Failed to obtain access token Backend Server | InternalOAuthError: Failed to obtain access token` ### Steps to reproduce 1. Goto the page and click login with Micrsoft 2. After redirected back to backend app then I got the error on the log. here is my Azure AD Application. Register Manifresh ```json { "id": "878eea34-734d-430b-a7a6-0d04485a43bf", "acceptMappedClaims": null, "accessTokenAcceptedVersion": null, "addIns": [], "allowPublicClient": null, "appId": "95acfcdb-a8a6-4aae-b3f6-da7e8a24b124", "appRoles": [], "oauth2AllowUrlPathMatching": false, "createdDateTime": "2024-04-28T08:34:52Z", "description": null, "certification": null, "disabledByMicrosoftStatus": null, "groupMembershipClaims": null, "identifierUris": [], "informationalUrls": { "termsOfService": null, "support": null, "privacy": null, "marketing": null }, "keyCredentials": [], "knownClientApplications": [], "logoUrl": null, "logoutUrl": null, "name": "dev-hoppscotch", "notes": null, "oauth2AllowIdTokenImplicitFlow": false, "oauth2AllowImplicitFlow": false, "oauth2Permissions": [], "oauth2RequirePostResponse": false, "optionalClaims": null, "orgRestrictions": [], "parentalControlSettings": { "countriesBlockedForMinors": [], "legalAgeGroupRule": "Allow" }, "passwordCredentials": [ { "customKeyIdentifier": null, "endDate": "2026-04-28T08:35:53.608Z", "keyId": "ede10190-61b4-44a8-8104-57be477c8e2d", "startDate": "2024-04-28T08:35:53.608Z", "value": null, "createdOn": "2024-04-28T08:36:13.464369Z", "hint": "7.I", "displayName": "dev-hoppscotch" } ], "preAuthorizedApplications": [], "publisherDomain": "ad.drunkcoding.net", "replyUrlsWithType": [ { "url": "https://api.dev.local/v1/auth/microsoft/callback", "type": "Web" } ], "requiredResourceAccess": [ { "resourceAppId": "00000003-0000-0000-c000-000000000000", "resourceAccess": [ { "id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d", "type": "Scope" } ] } ], "samlMetadataUrl": null, "signInUrl": null, "signInAudience": "AzureADMyOrg", "tags": [], "tokenEncryptionKeyId": null } ``` ### Environment Release ### Version Self-hosted
Author
Owner

@baoduy commented on GitHub (May 10, 2024):

Hi @JoelJacobStephen May I check when this issue will be fixed or any workaround?

<!-- gh-comment-id:2103688252 --> @baoduy commented on GitHub (May 10, 2024): Hi @JoelJacobStephen May I check when this issue will be fixed or any workaround?
Author
Owner

@robinalexandre commented on GitHub (Jul 4, 2024):

Hi @baoduy,

Any news on this ?

<!-- gh-comment-id:2209173509 --> @robinalexandre commented on GitHub (Jul 4, 2024): Hi @baoduy, Any news on this ?
Author
Owner

@baoduy commented on GitHub (Aug 8, 2024):

Hi @baoduy,

Any news on this ?

There is no news from them

<!-- gh-comment-id:2275446426 --> @baoduy commented on GitHub (Aug 8, 2024): > Hi @baoduy, > > > > Any news on this ? There is no news from them
Author
Owner

@guillaumedeplancke commented on GitHub (Aug 12, 2024):

Hi!
I'm currently seeing the same "Failed to obtain access token", but with Github as auth provider.
Looking at how OAuth2 works, it seems like the server (on which the hoppscotch backend is running) needs to make a call to Github to obtain the access token.
In my deployment, all outgoing traffic needs to go through a proxy, to be able to access external/public resources.
Could this also be the case for you?

<!-- gh-comment-id:2284009908 --> @guillaumedeplancke commented on GitHub (Aug 12, 2024): Hi! I'm currently seeing the same "Failed to obtain access token", but with Github as auth provider. Looking at how OAuth2 works, it seems like the server (on which the hoppscotch backend is running) needs to make a call to Github to obtain the access token. In my deployment, all outgoing traffic needs to go through a proxy, to be able to access external/public resources. Could this also be the case for you?
Author
Owner

@ngoldack-arag commented on GitHub (Sep 6, 2024):

Hi! I'm currently seeing the same "Failed to obtain access token", but with Github as auth provider. Looking at how OAuth2 works, it seems like the server (on which the hoppscotch backend is running) needs to make a call to Github to obtain the access token. In my deployment, all outgoing traffic needs to go through a proxy, to be able to access external/public resources. Could this also be the case for you?

Hi, facing the same issue. Did you find a solution?

<!-- gh-comment-id:2334841623 --> @ngoldack-arag commented on GitHub (Sep 6, 2024): > Hi! I'm currently seeing the same "Failed to obtain access token", but with Github as auth provider. Looking at how OAuth2 works, it seems like the server (on which the hoppscotch backend is running) needs to make a call to Github to obtain the access token. In my deployment, all outgoing traffic needs to go through a proxy, to be able to access external/public resources. Could this also be the case for you? Hi, facing the same issue. Did you find a solution?
Author
Owner

@baoduy commented on GitHub (Jan 21, 2025):

Hi hoppscotch
This is a simple fix. Could you please help to check and fix the issue

Thanks
Steven

<!-- gh-comment-id:2603777661 --> @baoduy commented on GitHub (Jan 21, 2025): Hi hoppscotch This is a simple fix. Could you please help to check and fix the issue Thanks Steven
Author
Owner

@wefantasy commented on GitHub (Mar 12, 2025):

Hi! I'm currently seeing the same "Failed to obtain access token", but with Github as auth provider. Looking at how OAuth2 works, it seems like the server (on which the hoppscotch backend is running) needs to make a call to Github to obtain the access token. In my deployment, all outgoing traffic needs to go through a proxy, to be able to access external/public resources. Could this also be the case for you?

same problem

<!-- gh-comment-id:2716320462 --> @wefantasy commented on GitHub (Mar 12, 2025): > Hi! I'm currently seeing the same "Failed to obtain access token", but with Github as auth provider. Looking at how OAuth2 works, it seems like the server (on which the hoppscotch backend is running) needs to make a call to Github to obtain the access token. In my deployment, all outgoing traffic needs to go through a proxy, to be able to access external/public resources. Could this also be the case for you? same problem
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#1415
No description provided.