1

The REST API for Secure Gateway has a GET operation located at /v1/sgconfig. It has a single, mandatory parameter: Authorization.

What should the value of this parameter be and where is that value located?

The VCAP_SERVICES environment variables for Secure Gateway only contain org_id and space_id.

The Bluemix Secure Gateway Configuration API documentation is rather sparse!

Bobby Woolf
  • 707
  • 1
  • 6
  • 13
Lokesh Sreedhar
  • 151
  • 3
  • 12
  • Lokesh: To see the REST docs for this operation, go to: https://www.ng.bluemix.net/docs/api/content/api/securegateway/swagger/index.html#!/operations/getConfigs. To see stuff on that page, you need to press Show/Hide and either click on the operation or press Expand Operations. – Bobby Woolf Jun 04 '15 at 19:21
  • Thanks Bobby, Alex helped me out – Lokesh Sreedhar Jun 15 '15 at 17:36

1 Answers1

1

Lokesh,

The GET /v1/sgconfig call requires the user give either a Bluemix Bearer token or their Bluemix username and password base 64 encoded in the auth header.

For example, if my org id was AlsOrg, space id was AlsSpace, username was alex@us.ibm.com, and password was password, I could execute this request:

curl https://sgmanager.ng.bluemix.net/v1/sgconfig?org_id=AlsOrg&space_id=AlsSpace -H "Authorization: Basic YWxleEB1cy5pYm0uY29tOnBhc3N3b3Jk"

Note: the base urls in the document you linked appear to be incorrect. I will make sure these are updated.

Also, the org and space IDs should be the GUIDs. You can access these in the URL as query parameters when you log in to Bluemix.

Bobby Woolf
  • 707
  • 1
  • 6
  • 13
Alex Yurkowski
  • 1,676
  • 1
  • 12
  • 26
  • Alex, how do i obtain a configurationID ? the rest of urls seems to use configurationID. – Lokesh Sreedhar Jun 04 '15 at 15:42
  • The configuration ID is the gateway ID. It would be the id property in the gateway objects returned in the list call you asked about, or it is accessible on the UI by clicking the info button on a gateway's tile. – Alex Yurkowski Jun 04 '15 at 17:25
  • Thanks for your Response, But i see the following error when i try the Rest Calls with configurationID on both ng and stage1.ng bluemix environment { "name": "JsonWebTokenError", "message": "jwt malformed" } – Lokesh Sreedhar Jun 04 '15 at 20:02
  • It sounds like you are now attempting a different API call without using the security token provided(the JWT). The security token is provided on the UI if you click the gateway information tile and click the copy button. On the API calls, I believe it is returned under the property "jwt" for the gateway/config object. If you provide the API call you are attempting, I can provide an example. – Alex Yurkowski Jun 04 '15 at 22:56