After finish of OIDC authentication, Keycloak will redirect to your application with the "code" parameter. Keycloak will always do this, it doesn't matter if you authenticated through SAML identity broker or username/password form or any other method. Then you theoretically need to exchange the code for access-token in backchannel request, however as long as you use our adapters, you don't need to care about it as adapter will do it for you.

We have examples (using adapters) where you can also see how is bearer access token retrieved and then used for additional REST calls to REST endpoints secured by bearer token. See the demo example and the "customer-portal" and "product-portal" applications.

Marek

On 08/12/15 16:48, Ton Swieb wrote:
Hi,

How can I obtain a bearer token from keycloak without using the direct access grant (http://keycloak.github.io/docs/userguide/keycloak-server/html/direct-access-grants.html).

I have configured a SAML Identity Broker in Keycloak which handles the login for my realm. As a result I do not have a username/password combination to POST it to:

/{keycloak-root}/realms/{realm-name}/protocol/openid-connect/token

How would I obtain a bearer token in this situation?

Kind regards,

Ton


_______________________________________________
keycloak-user mailing list
keycloak-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/keycloak-user