Get API OAuth token using HTTP Request app

Post Reply
wkopp
Member
Posts: 25
Joined: Mon Sep 16, 2019 8:20 pm

Get API OAuth token using HTTP Request app

Post by wkopp »

Hello everyone,

I'm trying to get an API Token using the HTTP request app but I don't have any experience in this area. I have tested the connection and details using Postman and that works fine. I just don't know where to include that info in the HTTP request app. I haven't found any good details for using the app. Apparently they expect the user to have some idea of what they're doing. :) (Once I get the token I'll need to use it in a second http request to get info from an API.)

This is what I have in Postman Authorization Settings (actual URL and credentials have been replaced):

- Configure New Token section -
Token Name: bearer
Grant type: Client Credentials
Access Token URL: https://myurl.com/OmsIdentityServer/connect/authorize
Client ID: myclientID
Client Secret: myclientSecret
Scope: myScope
Client Authentication: Send as Basic Auth header


This is what I have in the Switch HTTP request Settings:

URL: https://myurl.com/OmsIdentityServer/connect/authorize
Request Type: GET
Authentication scheme: OAuth
Authorization: client_id=myclientID client_secret=myclientSecret
Parameters:
scope=myScope
Headers:
<none>
Response: Inject as new job

Any help will be greatly appreciated!
Thanks as always...
freddyp
Advanced member
Posts: 1133
Joined: Thu Feb 09, 2012 3:53 pm

Re: Get API OAuth token using HTTP Request app

Post by freddyp »

In Postman I do not find the authorization "Send as Basic Auth header". There is "Basic Auth", but that requires a username and a password and is probably not what you need. I suggest that you export the Postman settings as a JSON and upload it here (you may have to zip it). It is of course OK to use fake values.
wkopp
Member
Posts: 25
Joined: Mon Sep 16, 2019 8:20 pm

Re: Get API OAuth token using HTTP Request app

Post by wkopp »

Here's the export from Postman.

I've been hunting around for answers and it looks like I should be using a POST method instead of GET. I've tried combinations of putting credentials in a json file for the "Attached file" as well as adding them in Parameters or Headers sections but no luck so far.

I appreciate you taking a look freddy...
Attachments
Token Generated.postman_collection.zip
(711 Bytes) Downloaded 2 times
Post Reply