A Flask extension to support Sign in with Apple
Project description
Flask Apple Login
A Flask extension for integrating Apple OAuth login seamlessly into your Flask applications.
Overview
Flask Apple Login is a simple and easy-to-use Flask extension that enables Apple OAuth login for your Flask applications. This extension handles the OAuth flow, token retrieval, and user authentication using Apple's secure authentication system.
Features
- Easy integration with Flask applications
- Secure OAuth flow with Apple
- Configurable settings for client ID, team ID, key ID, and private key file
- Automatically handles the token retrieval process
Installation
Install Flask Apple Login using pip:
pip install flask-apple-login
Usage
Quick Start
1. Initialize your Flask application:
from flask import Flask, jsonify, request, session, redirect, url_for
from flask_login_apple import AppleLogin
app = Flask(__name__)
app.config['DEBUG'] = True
app.config['SECRET_KEY'] = 'your-secret-key'
app.config['APPLE_CLIENT_ID'] = 'your-client-id'
app.config['APPLE_TEAM_ID'] = 'your-team-id'
app.config['APPLE_KEY_ID'] = 'your-key-id'
app.config['APPLE_PRIVATE_KEY_FILE'] = '/path/to/your/private_key.pem'
apple_login = AppleLogin(app)
@app.route('/')
def index():
return jsonify({'message': 'Hello, World!'})
@app.route('/login')
def login():
return apple_login.authorize()
@app.route('/callback', methods=['GET', 'POST'])
def callback():
token = apple_login.callback()
return f'Logged in with token: {token}'
2. Run your Flask application:
flask run
Configuration
Add the following configuration variables to your Flask app:
- APPLE_CLIENT_ID: Your Apple client ID.
- APPLE_TEAM_ID: Your Apple team ID.
- APPLE_KEY_ID: Your Apple key ID.
- APPLE_PRIVATE_KEY_FILE: Path to your private key file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file flask_login_apple-0.1.2.tar.gz.
File metadata
- Download URL: flask_login_apple-0.1.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ef058fab372d48a7b34d661e937f86be372ff8e6aef33004e38ef94a5cd6ae3
|
|
| MD5 |
0d0a2644cdfd49070629fdf6031f9967
|
|
| BLAKE2b-256 |
da62de3d2900c2f8e7cacc97e387bc640a2c27b428c28b324ea0ae16e53e00f9
|
File details
Details for the file flask_login_apple-0.1.2-py3-none-any.whl.
File metadata
- Download URL: flask_login_apple-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dbf192e68181a2de9ed4c1b62b5e579189ea42fe790ec7169209a2ea3f0eff2
|
|
| MD5 |
a3692979dd03dfd9e8666ab02512039e
|
|
| BLAKE2b-256 |
f86717f3f7f59c61cfa3cb6953c70a4842082b7b214f4d5d8a45b336368dc716
|