authlib / authlib/example-oidc-server
Add OIDC Discovery support
- 主要言語
- Python
- スター
- 65
- フォーク
- 37
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
This makes it massively easier to integrate with existing oidc clients.
After getting the the `jwks_uri` endpoint to work as described in #2 I added this handler to get auto discovery to work:
```python
@bp.route("/.well-known/openid-configuration")
def well_known_openid_configuration():
def external_url(function_name):
return url_for(function_name, _external=True)
return jsonify({
"authorization_endpoint": external_url('.authorize_endpoint'),
"token_endpoint": external_url('.token_endpoint'),
"userinfo_endpoint": external_url('.userinfo_endpoint'),
"jwks_uri": external_url('.jwks_endpoint'),
# Do I even need this one?
# IMO the OIDC server doesn't have a concept of a user being still logged in? --mh
# "end_session_endpoint": "http://oidc:4000/openid/end-session",
"id_token_signing_alg_values_supported": [
"HS256",
"RS256"
],
"issuer": JWT_CONFIG['iss'],
"response_types_supported": [
"code",
# TODO check what it takes to support these too
# "id_token",
# "id_token token",
# "code token",
# "code id_token",
# "code id_token token"
],
"subject_types_supported": [
"public"
],
"token_endpoint_auth_methods_supported": [
# TODO is supporting both a good idea? --mh
"client_secret_post",
"client_secret_basic"
],
})
```
@lepture is there a way to add this to the example code? Or use this a starting point to add it? (I'm not particularly sure this is even right).
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
まず、#2 にある既存の jwks_uri エンドポイントと、この issue で提案されている /.well-known/openid-configuration ハンドラーを確認します。OpenID Connect Discovery の要件を確認し、一覧にあるエンドポイント、issuer、署名アルゴリズム、レスポンスタイプ、サブジェクトタイプ、トークン認証方式を確認します。既存の OIDC クライアントで動作する正しい Discovery エンドポイントをサンプルサーバーが公開できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- api, authentication
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100