ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportGet Microsoft Oauth2 token in IIB

Post new topicReply to topic
Get Microsoft Oauth2 token in IIB View previous topic :: View next topic
Author Message
vmanel
PostPosted: Wed Dec 30, 2020 10:39 am Post subject: Get Microsoft Oauth2 token in IIB Reply with quote

Acolyte

Joined: 12 Mar 2019
Posts: 57

Hi,

We are trying to get Ouath2 token from Microsoft in IIB using HTTP request node. But Microsoft Oauth2 token URL needs request in url encoded POST query string, in below format

POST /{tenant}/oauthv2.0/token HTTP/1.1
HOST: https://login.microsoft.com
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=abc&client_secret=xyz&scope=abc

We are setting all the attributes in esql using query string like

Set OutputRoot.HTTPRequestHeader."Content-Type" = 'application/x-www-form-urlencoded';
Set OutputLocalEnvironment.Destination.HTTP.QueryString.grant_type = 'client_credentials';

All these parameters will be set as shown above, but when the post request is sent we are getting 400 bad request error saying grant_type is not specified for the request, which is a generic error when there is issue in query string.

So, is it right way to construct the url encoded string, or does the above esql set query parameter in the following format https://url?grant_type=client_credentials instead of POST request format shown above?
Back to top
View user's profile Send private message
Campbell
PostPosted: Wed Jan 06, 2021 3:21 pm Post subject: Reply with quote

Novice

Joined: 18 Feb 2013
Posts: 11

What you have done is correct however you also need to create a security profile with propogation set to yes and assign it as the security profile on the node.

myFlowName#MyHTTPNodeName.securityProfileName=MyNewSecurityProfileConfigurableServiceName

The security profile can just have all default values except propagation must be true.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportGet Microsoft Oauth2 token in IIB
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.