cancel
Showing results for 
Search instead for 
Did you mean: 

SAP HANA 2.3. XSA Password Grant with Client and User Credentials: POST /oauth/token

draschke
Active Contributor
0 Kudos

Hi Experts,

we were following this really nice Blog from Florian Pfeffer.

How to get an access token from the XSUAA Service for external API accesses using the Password Grant...

I will skip all the in detail described steps within this post and come rapidly to the issue.

1. We could follow this steps to get the Token: works fine 🙂

{
    "access_token": "eyJhbGciOiJ82w",
    "token_type": "bearer",
    "refresh_token": "863613a162af46a2b",
    "expires_in": 43199,
    "scope": "openid external-api-access.Display",
    "ext_attr": {
        "enhancer": "XSUAA"
    },
    "jti": "d04b921e2d194e87902a70cab8c80e18"
}

2. Get the Endpoint

/api/testEndpoint:

This works, if we are registered additionally with the User on the Login of this application.

{
    "success": true
}

But if we aren't registered , we get this redirect link.

Any ideas, what we are doing wrong?

Thanks a lot!

Accepted Solutions (1)

Accepted Solutions (1)

HPSeitz
Active Participant

Hi Dirk,

the target of your request needs to go directly to the service endpoint (port of node/xsjs module) and
not through the approuter (port web/html5 module).

BR, HP

draschke
Active Contributor
0 Kudos

You are absolutely right! After using the js port it works as expected. 🙂

Thank you really very much!

Answers (0)