# Getting the Python keycloak client to work

**URL:** <https://forum.keycloak.org/t/getting-the-python-keycloak-client-to-work/10516>\
**Category:** Getting advice\
**Created:** [August 12, 2021, 3:28pm UTC](https://forum.keycloak.org/t/getting-the-python-keycloak-client-to-work/10516 "2021-08-12T15:28:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisadkin](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/chrisadkin/32/3710_2.png) [@chrisadkin](https://forum.keycloak.org/u/chrisadkin)\
**Post date:** [August 12, 2021, 3:28pm UTC](https://forum.keycloak.org/t/getting-the-python-keycloak-client-to-work/10516/1 "2021-08-12T15:28:17Z")

</div>

I have been using the code samples available in [Welcome to Python Keycloak Client’s documentation! — Python Keycloak Client 0.2.4-dev documentation](https://python-keycloak-client.readthedocs.io/en/latest/) in order to get a Python based client working, specifically this code excerpt:

```auto
from keycloak.realm import KeycloakRealm

realm = KeycloakRealm(server_url='https://example.com', realm_name='my_realm')

oidc_client = realm.open_id_connect(client_id='my-client',
                                    client_secret='very-secret-client-secret')

```

It looks like the keycloak.realm package has moved on since the documentation was produced - the code fails due to a missing third parameter because the code fails with the following error message:

oidc\_client = realm.open\_id\_connect(client\_id=‘python’, client\_secret=’’)  
At line:1 char:55  
oidc\_client = realm.open\_id\_connect(client\_id=‘python’, client\_secret …  
~  
Missing argument in parameter list.  
+ CategoryInfo : ParserError: ( : ) [], ParentContainsErrorRecordException  
+ FullyQualifiedErrorId : MissingArgument

I suspect that the missing third parameter is a self parameter derived from the config.py, are there any code samples based on the realm.py package that work that someone can point me to ?
