on ‎2020 Oct 10 7:15 AM
Hi gurus,
I'm trying to get Bearer token from cloud foundry API in order to get information related with deploys ( like CF client with command mta-ops).
Unfortunally, I can't get the authorization.
Could you give some information about the authorization for this API? And if anybody have and example it would be fantastic!
Thanks in advance
Regards
Enric
Request clarification before answering.
My pull request: cloud-cap-multitenancy/pull/1/files contains an example working in REST client.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Gregor! As always, your post and answers are an inspiration!
I has checked your example with postman and works fine 🙂
Hi Gregor.
I am trying to get the bearer token with the authorization endpoint POST https://login.cf.eu20.hana.ondemand.com/oauth/token?grant_type=password and passed CF username and password(same user used for cf login) in the body but it gives invalid_client error. With the access token I want to access the CF API /v3/audit_events to get the deployed app's audit events. When I pass the token returned by CF command cf oauth-token I am able to get the audit events. Looking to get the same token with REST client.
In the git example the authorization header has been passed with some static value which is confusing.
Hi,
I'm not familiar with it, just in case it helps:
are you using your platform user and are you using
cf oauth-token
to get the jwt ?
Cheers,
Carlos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Enric,
For access token signing and verification across your configuration, ensure that the JWT settings are exactly the same for every web node. These JWT settings are defined on each web node in the configuration file, appsetting.json. As defined by HTTP/1.1 [RFC2617], the application should send the access_token directly in the Authorization request header. You can do so by including the bearer token's access_token value in the HTTP request body as 'Authorization: Bearer {access_token_value}'. When the API call is sent with the token, Machine Learning Server attempts to validate that the user is successfully authenticated and that the token itself is not expired. If an authenticated user has a bearer token's access_token or refresh_token that is expired, then a '401 - Unauthorized (invalid or expired refresh token)' error is returned. If the user is not successfully authenticated, a '401 - Unauthorized (invalid credentials)' error is returned.
Cheers,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 13 | |
| 7 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.