How to generate the OAuth URL

Hello, all. I am new to Nylas. I am trying to integrate Nylas with my vue 3 app. First of all, I don’t know how to generate the OAuth URL

Hello @hamzahyounus we have a lot of blog posts and docs talking about that :slight_smile: Don’t think any touches Vue :thinking: But they touch Node and React so you should be able to sort things out…if don’t let me know :slight_smile:

Thanks, Blag. I figured it out. Currently I have another problem related to CORS

Have you registered your callbackURI in your dashboard like explained here? Email API Quickstart: read and send email messages | Nylas Docs

Yes, I did!


And this is the function that generates the access token

@hamzahyounus I’m not a Node user, so this is harder for me to figure out, but I don’t see where you are passing the auth header…

--header 'Authorization: Bearer <token>' \

https://www.postman.com/trynylas/nylas-api/request/7nk6glc/hosted-oauth-token-exchange

This is the postman request and the response


In this case, the error is that redirect_uri should be http://localhost:4567/aauth/exchange

I did something, and it worked. First of all, you were right I had to add the Bearer Token, it slipped my mind. But the CORS problem was due to this here

1 Like

Thanks, Blag. You were helpful

I’m glad you fixed it :smiley: As I said…I’m not a Node user…so I never had to use JavaScript as a platform :thinking: Will take into account for whenver someone have this problem :wink:

1 Like

Thanks again, Blag. You’ve broadened my perspective and helped me see things more clearly. I wanted to share the solution that worked for me so that anyone facing the same issue can avoid the same struggle :grin:.

2 Likes

Thanks @hamzahyounus that’s the spirit :partying_face:

1 Like