Thanks to visit codestin.com
Credit goes to github.com

Skip to content

FR - directly define authority/token eps with tenant id in config.yml  #16

@pandel

Description

@pandel

Hi!

I was trying to test SMTP2Graph in a very restricted company network and found out, that it is not possible to acquire the authority and token endpoints via the tenant name like it is done in Mailer.ts atm via

authority: `https://login.microsoftonline.com/${Config.clientTenant}.onmicrosoft.com`,

according to this error message in the log:

{"error":"endpoints_resolution_error: Endpoints cannot be resolved","filename":"nicmdqos5k6ey4co.eml","level":"error","message":"[MailQueue] Failed to send message \"nicmdqos5k6ey4co.eml\"","name":"ClientAuthError","stack":"ClientAuthError: endpoints_resolution_error: Endpoints cannot be resolved\n    at os (dist/server.js:2:867462)\n    at Br.createDiscoveredInstance (dist/server.js:2:934155)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async pa.value.f.clientId.auth.authority.buildOauthClientConfiguration (dist/server.js:2:991352)\n    at async pa.value.f.clientId.auth.authority.acquireTokenByClientCredential (dist/server.js:2:1007400)\n    at async dist/server.js:2:1006373","timestamp":"2024-06-27T11:47:57+02:00"}

In another, but commercial application running in this environment the vendor had to make the OAuth endpoints definable directly (aka via the tenant ID):

(anonymized)

OAuth 2.0 authorization endpoint (v2):   https://login.microsoftonline.com/XXXXXXXX-BBBB-4019-KKKK-FFFFFFFFFFFF/oauth2/v2.0/authorize
OAuth 2.0 token endpoint (v2):   https://login.microsoftonline.com/XXXXXXXX-BBBB-4019-KKKK-FFFFFFFFFFFF/oauth2/v2.0/token

Would this be possible here, too?

Regards,
Holger

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions