简体   繁体   中英

Get token from API Microsoft Graph

How to get the token from en API Microsoft Graph from a Talend job? Under postman it's ok to generate the token but with a tRest component I don't know what kind of parameters I should use and where. All I get is a status200 answer that ask me to sign in.

I tried multiple kind of connection with tRest. Adding a xml body too. If I use the token from postman with a classic API call in Talend, for exemple https://graph.microsoft.com/v1.0/me , it works. So I need to get first the token.

You can do this with the below workflow: tREST -> tExtractJson -> tSetGlobalVar

工作流程

As per the Microsoft documentation, tREST configuration is as per the below (with client secret): 在此处输入图像描述

Replace the yellow bits with your own details.

Then extract your token from the response body and save it into globalMap for future use.

If you use other methods than shared secret to identify, look at the Microsoft Graph API documentation Get a Token to see what information you need to send in your POST request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM