[keycloak-user] Invoking admin REST API.

Kunal K kunal at plivo.com
Tue Jan 19 09:02:08 EST 2016


Hi all,

I referred to the doc[0] regarding Initial Access Token and generated a new
token for my realm.

I'm using the python requests library to invoke the GET realms API[1] but I
get a 401 Unauthorized status code. Am I doing it wrong? Below is my code.

import requests
authorization = {'Authorization': 'Bearer eyJhbGciOiJS.<redacted>'}

response = requests.get('http://keycloak-server.com/auth/admin/realms',
headers=authorization)
response.status_code // 401

​


[0]
https://keycloak.github.io/docs/userguide/keycloak-server/html/client-registration.html#d4e1450
[1]
http://keycloak.github.io/docs/rest-api/index.html#_get_accessible_realms

-- 
*KUNAL KERKAR *| PRODUCT ENGINEER
Plivo, Inc. 340 Pine St, San Francisco - 94104, USA
Web: www.plivo.com | Twitter: @plivo <http://twitter.com/plivo>, @tsudot
<http://twitter.com/tsudot>

Free Incoming SMS for All US Short Codes – Get One Today!
<https://www.plivo.com/sms-short-code/?utm=emailsig>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-user/attachments/20160119/beb937b7/attachment.html 


More information about the keycloak-user mailing list