Skip to main content
Solved

Connection to Microsoft Graph API


sigtill
Supporter
Forum|alt.badge.img+24

Have anyone managed to connect to Microsoft Graph API? I am thinking about the authentication part

 

https://developer.microsoft.com/en-us/graph

The authentication is described here: https://developer.microsoft.com/en-us/graph/docs/concepts/auth_overview

Any help?

Best answer by gerhardatsafe

@sigtill

I uploaded a Microsoft Graph Web Connection to the FME Hub:

 

https://hub.safe.com/web_connections/microsoft-graph

 

 

You will need to create an app here to use the Web Connection: https://apps.dev.microsoft.com/

Once you add your client ID and client secret you can use the Web Connection as authentication in the HTTPCaller.

View original
Did this help you find an answer to your question?

8 replies

Forum|alt.badge.img
@sigtill

I uploaded a Microsoft Graph Web Connection to the FME Hub:

 

https://hub.safe.com/web_connections/microsoft-graph

 

 

You will need to create an app here to use the Web Connection: https://apps.dev.microsoft.com/

Once you add your client ID and client secret you can use the Web Connection as authentication in the HTTPCaller.


sigtill
Supporter
Forum|alt.badge.img+24
  • Author
  • Supporter
  • August 21, 2018
gerhardatsafe wrote:
@sigtill

I uploaded a Microsoft Graph Web Connection to the FME Hub:

 

https://hub.safe.com/web_connections/microsoft-graph

 

 

You will need to create an app here to use the Web Connection: https://apps.dev.microsoft.com/

Once you add your client ID and client secret you can use the Web Connection as authentication in the HTTPCaller.

Spot on Gerhard! I always forget the web-connections. And I havent used it a lot. I am guessing its also possible to create a similar web-connection towards Leica Conx (https://knowledge.safe.com/questions/65547/data-tofrom-leica-conx.html) - I will have a dive into that when there is some spare-time!

 

 


sigtill
Supporter
Forum|alt.badge.img+24
  • Author
  • Supporter
  • September 5, 2018
gerhardatsafe wrote:
@sigtill

I uploaded a Microsoft Graph Web Connection to the FME Hub:

 

https://hub.safe.com/web_connections/microsoft-graph

 

 

You will need to create an app here to use the Web Connection: https://apps.dev.microsoft.com/

Once you add your client ID and client secret you can use the Web Connection as authentication in the HTTPCaller.

It seems the token times out after 1 hour and I need to sign in again - is there an error in the refresh-token string? @GerhardAtSafe

 


sigtill
Supporter
Forum|alt.badge.img+24
  • Author
  • Supporter
  • September 5, 2018
gerhardatsafe wrote:
@sigtill

I uploaded a Microsoft Graph Web Connection to the FME Hub:

 

https://hub.safe.com/web_connections/microsoft-graph

 

 

You will need to create an app here to use the Web Connection: https://apps.dev.microsoft.com/

Once you add your client ID and client secret you can use the Web Connection as authentication in the HTTPCaller.

I also added a comment regarding changing scope: https://hub.safe.com/web_connections/microsoft-graph

 

 

NB! Remember to change the scope to suit what you need access to: for instance mail.read or calendars.read etc. If not - it will not work. And documentation is available here: https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/beta-overview

 

 


Forum|alt.badge.img
sigtill wrote:
I also added a comment regarding changing scope: https://hub.safe.com/web_connections/microsoft-graph

 

 

NB! Remember to change the scope to suit what you need access to: for instance mail.read or calendars.read etc. If not - it will not work. And documentation is available here: https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/beta-overview

 

 

It's a good point, I'll add this to the description.

 

 


Forum|alt.badge.img
sigtill wrote:
It seems the token times out after 1 hour and I need to sign in again - is there an error in the refresh-token string? @GerhardAtSafe

 

There could be 2 reasons for this:

 

1. The redirect URI is missing in the refresh token request. We add it automatically to the retrieve token request, but not to the refresh request. You can try to add it as a query string to the token request. This is the example I followed by the way:

 

https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

 

 

2. You might need to grant the offline_access scope for your app the successfully retrieve refresh tokens:

 

https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-id-and-access-tokens#refresh-tokens

 

 

Let me know if you get a chance to test these 2 options. I will update the Web Connection on the Hub as soon as get to it so if you can confirm a fix by then that would be really helpful.

 

 

Thanks!

 


gerhardatsafe wrote:
There could be 2 reasons for this:

 

1. The redirect URI is missing in the refresh token request. We add it automatically to the retrieve token request, but not to the refresh request. You can try to add it as a query string to the token request. This is the example I followed by the way:

 

https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow

 

 

2. You might need to grant the offline_access scope for your app the successfully retrieve refresh tokens:

 

https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-id-and-access-tokens#refresh-tokens

 

 

Let me know if you get a chance to test these 2 options. I will update the Web Connection on the Hub as soon as get to it so if you can confirm a fix by then that would be really helpful.

 

 

Thanks!

 

You have to insert the "redirect_uri" as an URL, I tried with [REDIRECT_URI] at the Refresh Token Parameters - Request Format, but it didn't worked.

 

 


sigtill
Supporter
Forum|alt.badge.img+24
  • Author
  • Supporter
  • September 11, 2018
arnebrucksch wrote:
You have to insert the "redirect_uri" as an URL, I tried with [REDIRECT_URI] at the Refresh Token Parameters - Request Format, but it didn't worked.

 

 

@GerhardAtSafe - as @arnebrucksch says you need to add the redirect_uri as an URL.

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings