# Implementing keycloak in Explorer 2

**URL:** https://discourse.orthanc-server.org/t/implementing-keycloak-in-explorer-2/4378
**Category:** General
**Created:** [February 27, 2024, 7:23pm UTC](https://discourse.orthanc-server.org/t/implementing-keycloak-in-explorer-2/4378 "2024-02-27T19:23:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sijiem](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/s/bbce88/32.png) [@sijiem](https://discourse.orthanc-server.org/u/sijiem)
#### Post date: [February 27, 2024, 7:23pm UTC](https://discourse.orthanc-server.org/t/implementing-keycloak-in-explorer-2/4378/1 "2024-02-27T19:23:13Z")

</div>

I’ve setup an orthanc server in windows and trying to use explorer 2 with keycloak.

I was able to setup the connection between explorer 2 and keycloak and I can login successfully but the role permission is not working. I can still see all default permission in doctor user.

I’m not sure which config should I use and where should i put that config in the configuration folder since there’s no authorization.json or permissions.json (though I tried to create permissions.json but it is not working)

{  
“roles” : {  
“admin”: [“all”],  
“doctor”: [“view”, “download”, “share”, “send”]  
}  
}  
or

{  
“roles” : {  
“admin-role”: {  
“permissions”: [“all”],  
“authorized\_labels”: [“_“]  
},  
“doctor-role”: {  
“permissions”:[“view”, “download”, “share”, “send”],  
“authorized\_labels”: [”_”]  
},  
“external-role”: {  
“permissions”:[“view”, “download”],  
“authorized\_labels”: [“external”]  
}  
}  
}

This is the sample roles that I have.

 ![image](https://discourse.orthanc-server.org/uploads/default/original/2X/d/d3c67c127a34d87ef5b0f17a0878d48baf000f60.png)

---

<div class="post-metadata">

### Author: ![alainmazy](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/alainmazy/32/1576_2.png) [@alainmazy](https://discourse.orthanc-server.org/u/alainmazy)
#### Post date: [February 29, 2024, 6:02pm UTC](https://discourse.orthanc-server.org/t/implementing-keycloak-in-explorer-2/4378/2 "2024-02-29T18:02:38Z")

</div>

Hi,

The role permissions are handled by an external web-service like [this one](https://github.com/orthanc-team/orthanc-auth-service/tree/main/sources/orthanc_auth_service).

Sorry but we only provide [Docker based samples](https://github.com/orthanc-team/orthanc-auth-service/tree/main/minimal-setup/keycloak) but, if you do not wish to run it through Docker, you “just” have to start and configure all services independently.

Best regards,

Alain

---

<div class="post-metadata">

### Author: ![sijiem](https://discourse.orthanc-server.org/letter_avatar_proxy/v4/letter/s/bbce88/32.png) [@sijiem](https://discourse.orthanc-server.org/u/sijiem)
#### Post date: [March 2, 2024, 6:59am UTC](https://discourse.orthanc-server.org/t/implementing-keycloak-in-explorer-2/4378/3 "2024-03-02T06:59:44Z")

</div>

Hi Alain,

Thank you for your prompt response. I’ll delve deeper into the solution you provided. In case I encounter difficulties in implementing it successfully, I’m considering developing a custom application using the Laravel framework. My goal would be to replicate all the functionalities found in Explorer 2, particularly the viewers like Stone and OHIF. Is it possible to do so?

Thanks again for your assistance!

---

<div class="post-metadata">

### Author: ![alainmazy](https://discourse.orthanc-server.org/user_avatar/discourse.orthanc-server.org/alainmazy/32/1576_2.png) [@alainmazy](https://discourse.orthanc-server.org/u/alainmazy)
#### Post date: [March 4, 2024, 9:45am UTC](https://discourse.orthanc-server.org/t/implementing-keycloak-in-explorer-2/4378/4 "2024-03-04T09:45:01Z")

</div>

> [@sijiem](#):
>
> My goal would be to replicate all the functionalities found in Explorer 2, particularly the viewers like Stone and OHIF. Is it possible to do so?

Yes, it is possible to do so. Have fun 😉 !
