Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ client = FusionAuthClient('6b87a398-39f2-4692-927b-13188a81a9a3', 'http://localh
Each method in the client library includes documentation to describe the use and parameters. In addition to this resource, review the API documentation. https://fusionauth.io/docs/v1/tech/apis/

If you encounter issues with this library, please open an issue.

### Gotchas

If you need to pass a boolean to any methods, such as `logout`, pass a lowercase string value: `"true"` for `True`, `"false"` for `False`. See https://github.com/FusionAuth/fusionauth-python-client/issues/10 for more info on this issue.
28 changes: 28 additions & 0 deletions src/examples/python/login_logout.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import os
import json
from fusionauth.fusionauth_client import FusionAuthClient

api_key = "..."
app_id = "..."
host_ip = "localhost"

client = FusionAuthClient(api_key, "http://{}:9011".format(host_ip))

login_request = {
'applicationId': app_id,
'loginId': '[email protected]',
'password': 'password'
}

client_response = client.login(login_request)
if client_response.was_successful():
print(client_response.success_response)
else:
print(client_response.error_response)


client_response = client.logout("true", None)
if client_response.was_successful():
print(client_response.success_response)
else:
print(client_response.error_response)