ERROR 45001 How to resolve

How to resolve error: provider_code_request_failed 45001 400 Provider refused to return refresh_token using code (hosted auth) Provider??? no have solution

Hello @lcscamacho could you please provide your source so that I can take a look? Also the full error that you’re getting…

Microsoft, im trying this and get error 45001 from microsoft provider: const authUrl = nylas.auth.urlForOAuth2({
clientId: config.clientId,
provider: ‘microsoft’,
redirectUri: config.callbackUri,
loginHint: ‘email_to_connect’,
})

Have you created your connector? Start using the Nylas Sandbox | Nylas Docs

Also, here’s a Microsoft guide on our docs Use Microsoft accounts and data with Nylas | Nylas Docs

1 Like

i m following this guide Create grants with OAuth and an API key | Nylas Docs and this video https://www.youtube.com/watch?v=8luB4dJggtI&list=PLk-4iahO3b-xd42-RL4DJQyuEoFFYwTbC&index=80

I see…I did followed the video as well :sweat_smile: although it worked for me…could you post your source code? No need to post any keys obviously…just want to see what’s going wrong…which SDK are you using?

Also, have you tried with our QuickStart guides? Email API Quickstart: read and send email messages | Nylas Docs

yess, of course! this code: interface AuthInNylasToGetGrantIdProps {

urlCallback: string;
provider?: “google” | “microsoft”;
}
export const authInNylasToGetGrantId = async ({
urlCallback,
provider = “google”,
}: AuthInNylasToGetGrantIdProps) => {
const config = {
clientId: nylasConfigValidated.clientId,
callbackUri: urlCallback,
apiKey: nylasConfigValidated.apiKey,
apiUri: “https://api.us.nylas.com”,
};
const nylas = new Nylas({
apiKey: config.apiKey,
apiUri: config.apiUri,
});

const authUrl = nylas.auth.urlForOAuth2({
clientId: config.clientId,
provider,
redirectUri: config.callbackUri,
state: provider,
});

return { url: authUrl };
};

Thanks @lcscamacho I will take a look and let you know…it’s already nighttime for me :slight_smile:

good morning !! oh yes i wait

A couple of things…if you’re using Microsoft, you should mention Google at all…

Have you registered your callbackUri on the dashboard?

Otherwise, I don’t anything wrong with your code :thinking:

Again, have you take a look at this? Email API Quickstart: read and send email messages | Nylas Docs

I need sendo emails from Outlook of my client!

@lcscamacho I have been able to send emails from outlook using the Email API Quickstart guide that I provided you…have you tried with that one? Can you send me your project to alvaro.t@nylas.com so that I can run it?

Hey Alvaro, thanks for your attention, this is an issue that other users might be facing as well, and I believe it would be beneficial if we could have your attention for 30 minutes in a Google Meet call. We plan to be using Nylas for a long time and have many clients who rely on your services!

Hello @lcscamacho I would need you to send me your project to my email, so that I can run and figure out what’s missing or going wrong…I’m not a Node user so I need time to figure things out, but I need your full code (no API keys of course)

Hi @Blag I am also getting same error when I try to test grant from nylas v3 dashboard. I have completed Microsoft connector settings as mentioned in the document

Hello @Sharmila I would ask you the same, send me your code so that I can test it out and figure out what’s wrong…my email is on this thread.