Skip to content

Commit

Permalink
Add in sample login/logout app.
Browse files Browse the repository at this point in the history
  • Loading branch information
mooreds committed Dec 15, 2020
1 parent 2ced40c commit 417a345
Showing 1 changed file with 28 additions and 0 deletions.
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': 'user@fusionauth.io',
'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)

0 comments on commit 417a345

Please sign in to comment.