[keycloak-user] the admin rest api for realm import is not importing realm

Bruce Wings testoauth55 at gmail.com
Mon Oct 22 01:39:31 EDT 2018


Forgot to mention that sending request to: *http://localhost:8380/auth
<http://localhost:8380/auth/admin/realms>*   gives 415-Unsupported media
type error. Images for postman request attached




On Mon, Oct 22, 2018 at 10:16 AM Bruce Wings <testoauth55 at gmail.com> wrote:

> As mentioned in docs:
> https://www.keycloak.org/docs-api/4.5/rest-api/index.html#_realms_admin_resource
> when I send a request to : *http://localhost:8380/
> <http://localhost:8380/>* I  get   200 OK, but when I go and check on the
> admin console, new realm is not visible.
>
> *but when* I send a request to : *http://localhost:8380/auth/admin/realms
> <http://localhost:8380/auth/admin/realms>, *I get 401 unauthorized.
> (keycloak server running on port 8380 and I am sending the bearer token
> obtained from
> http://10.252.70.71:8380/auth/realms/master/protocol/openid-connect/token)
>
> Which is the accurate URL to import a realm json in keycloak? *http://localhost:8380/
> <http://localhost:8380/>* OR *http://localhost:8380/auth/admin/realms
> <http://localhost:8380/auth/admin/realms>*
>
>
> On Fri, Oct 19, 2018 at 7:43 PM Bruce Wings <testoauth55 at gmail.com> wrote:
>
>> Can anyone suggest whether there is something wrong in the way I am
>> sending request or is this an issue on keycloak side?
>>
>> On Thursday, October 18, 2018, Bruce Wings <testoauth55 at gmail.com> wrote:
>>
>>> As mentioned in docs:
>>>
>>>
>>> https://www.keycloak.org/docs-api/4.4/rest-api/index.html#_realms_admin_resource
>>>
>>> I have created a post request via postman and the response is 200 OK,
>>> but when I go and check on the admin console, new realm is not visible.
>>>
>>> Moreover, when I perform the same operation via an invalid token, then
>>> also the response is 200 OK. Am I missing something here?
>>>
>>> Attached screenshot of postman request. (In the body I have copy pasted
>>> entire contents of realm json file that was exported from another server)
>>>
>>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: import1.JPG
Type: image/jpeg
Size: 41694 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/keycloak-user/attachments/20181022/867323f8/attachment-0002.jpe 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: import2.JPG
Type: image/jpeg
Size: 105500 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/keycloak-user/attachments/20181022/867323f8/attachment-0003.jpe 


More information about the keycloak-user mailing list