cancel
Showing results for 
Search instead for 
Did you mean: 

OAuth Client on trial SAP Jam instance problem

Former Member
0 Kudos

Hi,

I'm trying to create OAuth Client on trial SAP Jam Instance to use it with XS destination.

When I do that I get Client ID, but no Secret key which I should store in the xsoatuhclientconfig file.

And because of that when I do SAP Jam API request, in response I receive an error that the account is not authorized.

Why the Secret Key is missing on developer.sapjam.com? Is this issue related with developer instance or am I missing something here?

Thanks,

Petar

Accepted Solutions (1)

Accepted Solutions (1)

Adam_Stone
Active Contributor
0 Kudos

Hi Petar,

As you are providing a X509 certificate, you do not have a secret.  This is expected as you would be using the certificate to sign the request instead.  Please take a look at the following page of our documentation: SAP Jam Collaboration Developer Guide

Thanks,
Adam

Former Member
0 Kudos

Hi Adam,

thanks for the answer, it was helpful, but didn't solved my problem entirely

I've created OAuth client without X509 certificate and secret key appeared. I've stored it in xsoauthconfig file, but again I'm receiving unauthorized error when trying to execute call for getting a single use token. This is the code that I'm trying to execute in xsjs:

var destination_package = "JobPts.services";

  var destination_name = "sap_jam";

  var dest = $.net.http.readDestination(destination_package, destination_name);

  var client = new $.net.http.Client();

  var req = new $.web.WebRequest($.net.http.POST, "");

  client.request(req, dest);

  var response = client.getResponse().body.asString();

  client.close();

  $.response.contentType = "application/json";     

  $.response.setBody(JSON.stringify(response));

  $.response.status = $.net.http.OK;

And the destination file is configured as:

host = "developer.sapjam.com";

port = 443;

pathPrefix = "/v1/single_use_tokens";

proxyType = none;

authType = SamlAssertionPropagation;

useSSL = true;

timeout = 0;

oAuthAppConfigPackage = "JobPts.services";

oAuthAppConfig = "sap_jam1";

sslHostCheck = true;

sslAuth = client;

I would appreciate if you can send some code samples for getting single use token from XS.

Thanks,

Petar

Adam_Stone
Active Contributor
0 Kudos

Hi Petar,

I don't have any sample XS code that I can provide, but looking at your settings, I'm not sure if this would work.  You look like you are directly trying to create an assertion and pass it to the single_use_token page, which is not how you do a SAML assertion.  You need to pass the assertion to api/v1/auth/token.  You would then use that token to create the single use token.

Thanks,
Adam

Answers (0)