cancel
Showing results for 
Search instead for 
Did you mean: 

How to use OAuth Credentials Artifact?

bhalchandraswcg
Contributor
0 Kudos

Hi,

I am implementing client credentials OAuth flow. Currently, I am using basic authentication to get token.

I was curious about using the OAuth Credentials Artifact instead. Unfortunately, I did not find much documentation on how to use it for simple HTTP scenario.

In release notes for 21 June 2014, I see that the OAuth Credentials Artifact can be used in SuccessFactors adapter using REST. The documentation only tells us how to deploy the artefact.

In addition, the SecureStoreService interface only has getUserCredential() method, which returns an object containing username and password.

Is it possible to use OAuth Credentials Artifact in other scenarios than mentioned above? Or is it just internal SAP feature?

Kind regards,

Bala

Accepted Solutions (0)

Answers (3)

Answers (3)

Hi Balachandar,

Seems there is no straightway via API, but you can try below way if you really want to use the oauth data in your credentials in script and similarily in your component if any . Mostly it works.. Simple tweak.

def service = ITApiFactory.getApi(SecureStoreService.class, null);

def credential = service.getUserCredential("testOdata");

def credentialprop = credential.getProperties();

String oauth = "Secret="+ new String(credentialprop.get("password"));

def others = credentialprop.get("credentialProperties");

def ClientID= others.get("user");

def LoginUrl=others.get("sec:server.url");

Cheers

Sreeni

bhalchandraswcg
Contributor
0 Kudos

Hi Balázs,

Thank you for the answer. The documentation you provided are applicable for Inbound scenario. The question is regarding Outbound scenarios.

Kind regards,

Bala

robsonchiarello
Explorer

Hi Bala,

Have you seen the Blog below? Perhaps the approach mentioned in it could help you to implement the OAuth:

HCI: Developing custom OAuth 2.0 authentication in iFlows

Regards,

Robson Chiarello

bhalchandraswcg
Contributor
0 Kudos

Hi Robson,

Thank you. I did look at the blog. I have implemented OAuth 2.0 using Basic Authentication. However, I am particularly interested in using OAuth Credentials Artifact.

Kind regards,

Bala