We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Trying to make OIDC work with Microsoft Entra ID.
AFFiNE.use('oauth', { providers: { oidc: { // OpenID Connect issuer: 'https://#.microsoftonline.com/<tenant_id>/v2.0', clientId: '<app_id>', clientSecret: '<app_secret>', args: { scope: 'openid email profile offline_access', claim_id: 'preferred_username', claim_email: 'email', claim_name: 'name', }, }, }, });
Web (app.affine.pro)
Chrome, Microsoft Edge, Firefox, Safari
affine_server | [Nest] 1 - 01/29/2025, 3:30:44 PM ERROR [HTTP] Internal server error affine_server | ZodError: [ affine_server | { affine_server | "code": "invalid_type", affine_server | "expected": "string", affine_server | "received": "undefined", affine_server | "path": [ affine_server | "preferred_username" affine_server | ], affine_server | "message": "Required" affine_server | } affine_server | ] affine_server | at get error [as error] (file:///app/node_modules/zod/lib/index.mjs:587:31) affine_server | at ZodObject.parse (file:///app/node_modules/zod/lib/index.mjs:663:22) affine_server | at OIDCClient.fetch (file:///app/dist/plugins/oauth/providers/oidc.js:45:25) affine_server | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) affine_server | at async OIDCClient.userinfo (file:///app/dist/plugins/oauth/providers/oidc.js:115:22) affine_server | at async OIDCProvider.getUser (file:///app/dist/plugins/oauth/providers/oidc.js:162:16) affine_server | at async OAuthController.callback (file:///app/dist/plugins/oauth/controller.js:69:31)
Permissions in Entra ID are set:
The text was updated successfully, but these errors were encountered:
you set preferred_username as claim_id but the content of user returned by your provider's endpoint doesn't contains such field
preferred_username
claim_id
Sorry, something went wrong.
Yea so turns out MS does not support that field. Who thought.
Can I choose any other one? Like email ? Any best practices from your side?
email
Much appreciated you took the time.
No branches or pull requests
What happened?
Trying to make OIDC work with Microsoft Entra ID.
Distribution version
Web (app.affine.pro)
What browsers are you seeing the problem on if you're using web version?
Chrome, Microsoft Edge, Firefox, Safari
Are you self-hosting?
Relevant log output
Anything else?
Permissions in Entra ID are set:
The text was updated successfully, but these errors were encountered: