![](https://cdn.discordapp.com/embed/avatars/4.png)
hi, I am trying to authenticate using the session secret generated when logged in using microsoft SSO. it works when I create a session using email and password but it's not working when I use the secret from microsoft SSO session
if I generate JWT and use setJWT, it works but only for 15 minutes. hence I am trying to use setSession instead for longer session expiry:
sessionPayload.session: {
$id: '67ad302a6fc23dc69f06',
$createdAt: '2025-02-12T23:35:06.460+00:00',
$updatedAt: '2025-02-12T23:35:06.460+00:00',
userId: 'redacted',
expire: '2026-02-12T23:35:06.457+00:00',
provider: 'microsoft',
providerUid: '9c407a08-9a02-4fec-8fa5-e5e57155f019',
providerAccessTokenExpiry: '2025-02-13T00:55:04.457+00:00',
providerAccessToken: 'redacted',
providerAccessToken: 'redacted',
ip: 'redacted',
osCode: 'WIN',
osName: 'Windows',
osVersion: '10',
clientType: 'browser',
clientCode: 'PS',
clientName: 'Microsoft Edge',
clientVersion: '132.0',
clientEngine: 'Blink',
clientEngineVersion: '132.0.0.0',
deviceName: 'desktop',
deviceBrand: '',
deviceModel: '',
countryCode: 'us',
countryName: 'United States',
current: false,
factors: [ 'email', 'oauth2' ],
secret: 'f89f31b1c0fa9ed998a55e537f1436fd78655d8b2860be0d43aa2d0d401f2545',
mfaUpdatedAt: ''
}
AppwriteException: User (role: guests) missing scope (account)
console.log("sessionPayload.session: ", sessionPayload.session);
const client = new Client().setEndpoint(process.env.CMS_ENDPOINT).setProject(process.env.CMS_PROJECT_ID).setSession(sessionPayload.session.secret);
const account = new Account(client);
userAccount = await account.get();
Recommended threads
- nextjs SSR session in CSR
Hi, How could you access the user session in a csr component I need access to the session for handling real time updates. As the cookie that contains the sessio...
- how to set cookies to custom domain?
Hi, I have appwrite selfhosted on https://cms.cyberitex.com, which is behind reverse proxy (plesk and nginx). 1. the domain is verified, but unable to issue c...
- I want cancel all my plans
I didn't use the paid plan, only the free trial in October 2024. I forgot to update my current plan, and a payment attempt was made. Since I haven't used any re...
![](/images/bgs/pre-footer.png)