tarickb / sasl-xoauth2

SASL plugin for XOAUTH2
Other
72 stars 20 forks source link

Cannot specify tenant ids for token refresh #80

Closed norbusan closed 5 months ago

norbusan commented 5 months ago

Thanks for the tool! I was able to get the initial token by passing --tenant=TENANT_ID to the sasl-xoauth2-tool get-token outlook ....

The token file is updated and contains access and refresh token.

I then try to test the renewal

$ sasl-xoauth2-tool test-token-refresh token-file
...
Token refresh failed.

with the error message being

AADSTS7000012: The grant was obtained for a different tenant.

I tried the following steps:

Looking at the code, the refresh etc is done by /usr/lib/sasl-xoauth2/test-config but that doesn't support --tenant.

How am I supposed to make sure that a correct tenant is used?

Thanks

norbusan commented 5 months ago

Closing this issue, I was blind.

The tenant id needs to be put into the config file into token_endpoint configuration.