Arturo2R
Arturo2R
CCConvex Community
Created by Arturo2R on 7/20/2024 in #support-community
Convex Auth Error with Microsoft Entra
Great thanks @ballingt
23 replies
CCConvex Community
Created by Arturo2R on 7/20/2024 in #support-community
Convex Auth Error with Microsoft Entra
Hi @ballingt it seems the pull request to fix the issue on authjs will take time to get approved and merged. Meanwhile my development have been halted for nearly a month. There is a way a can modify the dependencies used by the auth convex backend. To put the patch? Or i have to self host to do that?
23 replies
CCConvex Community
Created by Arturo2R on 7/20/2024 in #support-community
Convex Auth Error with Microsoft Entra
Hi @ballingt you just need a microsoft account register and app, and enter entra.microsoft.com register new app and create an api key, authjs have a better documentation https://authjs.dev/getting-started/providers/microsoft-entra-id.
23 replies
CCConvex Community
Created by Arturo2R on 7/20/2024 in #support-community
Convex Auth Error with Microsoft Entra
Yep oauth rigth now has a problem with microsoft entra, and the fix merge is in process but can it may take a while. I need to patch the version that convex uses on ther server, convex supports patches ? How do i pass my patch to the server?
diff --git a/build/index.js b/build/index.js
index 5ff49a6829964666737efcec17e344930a8d592e..f777ff31c685c6d10bd01b7acb89f0e273e9d265 100644
--- a/build/index.js
+++ b/build/index.js
@@ -1029,11 +1029,17 @@ function validateOptionalIssuer(expected, result) {
}
return result;
}
+//replace 'common' with 'organizations' or 'consumers' if using a different account type for the Entra app:
function validateIssuer(expected, result) {
- if (result.claims.iss !== expected) {
- throw new OPE('unexpected JWT "iss" (issuer) claim value');
+ if (expected === 'https://login.microsoftonline.com/common/v2.0'
+ && result.claims.tid !== undefined
+ && result.claims.iss === `https://login.microsoftonline.com/${result.claims.tid}/v2.0`) {
+ return result;
}
- return result;
+ if (result.claims.iss === expected) {
+ return result
+ }
+ throw new OPE('unexpected JWT "iss" (issuer) claim value')
}
const branded = new WeakSet();
function brand(searchParams) {
diff --git a/build/index.js b/build/index.js
index 5ff49a6829964666737efcec17e344930a8d592e..f777ff31c685c6d10bd01b7acb89f0e273e9d265 100644
--- a/build/index.js
+++ b/build/index.js
@@ -1029,11 +1029,17 @@ function validateOptionalIssuer(expected, result) {
}
return result;
}
+//replace 'common' with 'organizations' or 'consumers' if using a different account type for the Entra app:
function validateIssuer(expected, result) {
- if (result.claims.iss !== expected) {
- throw new OPE('unexpected JWT "iss" (issuer) claim value');
+ if (expected === 'https://login.microsoftonline.com/common/v2.0'
+ && result.claims.tid !== undefined
+ && result.claims.iss === `https://login.microsoftonline.com/${result.claims.tid}/v2.0`) {
+ return result;
}
- return result;
+ if (result.claims.iss === expected) {
+ return result
+ }
+ throw new OPE('unexpected JWT "iss" (issuer) claim value')
}
const branded = new WeakSet();
function brand(searchParams) {
https://github.com/nextauthjs/next-auth/issues/8374 https://github.com/nextauthjs/next-auth/pull/9718
23 replies
CCConvex Community
Created by Arturo2R on 7/20/2024 in #support-community
Convex Auth Error with Microsoft Entra
23 replies
CCConvex Community
Created by Arturo2R on 7/20/2024 in #support-community
Convex Auth Error with Microsoft Entra
Microsoft entra is the oauth library of microsoft. I was searching someway of debugging the JWT. I find an option in authjs to activate the debug flag. But i don't know how to access that from convex auth.
23 replies
CCConvex Community
Created by Arturo2R on 7/20/2024 in #support-community
Convex Auth Error with Microsoft Entra
No description
23 replies
CCConvex Community
Created by Arturo2R on 7/20/2024 in #support-community
Convex Auth Error with Microsoft Entra
What could be the cause of the cookie missing?
23 replies
CCConvex Community
Created by Arturo2R on 7/20/2024 in #support-community
Convex Auth Error with Microsoft Entra
No description
23 replies