using oAuth for microsoft api, but i am getting a...
# cfml-beginners
g
using oAuth for microsoft api, but i am getting an issue when a token request is made.
s
You will need to provide more details about the issue if you need help
g
sorry this message was intended to be send with the next message where i added a screenshot, but somehow it went through
s
Put that other message in this thread
g
Here is what i am doing its failing on the makeAccessTokenRequest using this to connect https://github.com/coldfumonkeh/oauth2
if i am not wrong, its failing when i am initializing it like this
and what should i add here, if i skip it throws error
do i need to make some changes in the4 azure portal ?
s
Looks like you don’t have any local dns set up for your fake auth provider url
Probably you will need to add a host file entry and configure a web server to handle requests for that domain authprovider.fake
Or you need to update that line of code to point to the auth provider you want to test against
g
when you say host file entry and configure a web server where i have to make this change, because i am not sure there is any hostfile associated to this unless you are taking about hosts file in windows and if yes what url i need to provide to that fake url,
can you explain your both cases, the last one also, to auth provider to test against
so its microsoft api, so same url as authorize for token
let me see if bthere any other url for token
s
do you have a sandbox account on the microsoft api?
g
no
i have my own account and used that for the azure portal
i created keys and everything
s
you need update that line of code that came from the example to not have authprovider.fake and instead point to the url the microsoft says to point to in their documentation
based on my quick google search it might be https://login.microsoftonline.com/common/v2.0/oauth2/token
assuming that is what you are trying to implement
(forget about the hosts file thing, I mis understood what was happening... it looks like you just copied some code and didn't change that line. I had assumed you intended for it to be pointed to that fake auth provider)
g
seems like the url you gave me works, just have to replace common with the tenantID and it worked
👍 1
got it to authentcate, now i am sure i am missing something in the docs, i am trying to call the calendar url https://graph.microsoft.com/v1.0/me/events?$select=subject,body,bodyPreview,organizer,attendees,start,end,location
Copy code
and the error i am getting is The tenant for tenant guid '344344346-676-ad-863f-c27c7eeceba8' does not exist
i think i got whay it is happening