appwrite/docs/examples/1.5.x/server-python/examples/account/create-o-auth2session.md

16 lines
461 B
Markdown
Raw Normal View History

2024-02-05 12:40:51 +00:00
from appwrite.client import Client
2024-02-21 11:31:50 +00:00
from appwrite.enums import OAuthProvider
2024-02-05 12:40:51 +00:00
client = Client()
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
2024-02-21 11:31:50 +00:00
client.set_project('5df5acd0d48c2') # Your project ID
2024-02-05 12:40:51 +00:00
account = Account(client)
2024-02-21 11:31:50 +00:00
result = account.create_o_auth2_session(
provider = OAuthProvider.AMAZON,
success = 'https://example.com', # optional
failure = 'https://example.com', # optional
scopes = [] # optional
)