flagflag  If you want to see English page, please click "English" Button at Left.
2: 2021-07-14 (水) 16:28:08 iseki ソース 3: 2021-07-14 (水) 18:33:46 iseki ソース
Line 1: Line 1:
** Hack for Moodle LTI [#w4c22429] ** Hack for Moodle LTI [#w4c22429]
-*** Moodle が JupyterHub に送るデータ [#uff7064e] +*** [[JupyterHub]] の Swapner での受け取り処理 [#vd91a1e1] 
-- args+- jupyterhub_config.py 
 + import os 
 + os.environ['JUPYTERHUB_CRYPT_KEY'] = 'c283a5e73c8f74cdc8c6fef5415f1c97948a5a5​450b5dc7524b9939093a2bd1d' 
 + ....... 
 + ....... 
 +     def userdata_hook(self, auth_state): 
 +         print("AURTH") 
 +         print(auth_state) 
 + ....... 
 + ....... 
 + c.Spawner.auth_state_hook = ProjectDockerSpawner.userdata_hook 
 + c.Authenticator.enable_auth_state = True 
 + 
 +- 環境変数 の設定が必要 
 +-- キーは openssl rand -hex 32 で生成 
 + 
 + AUTH 
 + { 
 +     'user_id': '3185', 
 +     'lis_person_sourcedid': '', 
 +     'roles': 'Learner', 
 +     'context_id': '98', 
 +     'context_label': 'TEST2_1', 
 +     'context_title': 'TEST2 コピー 1', 
 +     'resource_link_title': 'JupyterHub', 
 +     'resource_link_description': '', 
 +     'resource_link_id': '10', 
 +     'context_type': 'CourseSection', 
 +     'lis_course_section_sourcedid': '', 
 +     'lis_result_sourcedid': '{ 
 +         "data":{ 
 +             "instanceid":"10", 
 +             "userid":"3185", 
 +             "typeid":"2", 
 +             "launchid":2017829967 
 +         }, 
 +         "hash":"308a29656cd8db974c65870ad7f75070c2fc3440​4b12536ee45c5a06b4e1f5f8" 
 +     }', 
 +     'lis_outcome_service_url': 'https://el.mml.tuis.ac.jp/moodle/mod/lt​i/service.php', 
 +     'lis_person_name_given': 'j19344', 
 +     'lis_person_name_family': 'j19344', 
 +     'lis_person_name_full': 'j19344 j19344', 
 +     'ext_user_username': 'j19344hn', 
 +     'lis_person_contact_email_primary': 'j19344hn@edu.tuis.ac.jp', 
 +     'launch_presentation_locale': 'ja', 
 +     'ext_lms': 'moodle-2', 
 +     'tool_consumer_info_product_family_code'​: 'moodle', 
 +     'tool_consumer_info_version': '2020110902', 
 +     'lti_version': 'LTI-1p0', 
 +     'lti_message_type': 'basic-lti-launch-request', 
 +     'tool_consumer_instance_guid': '5384b0f81508b987c188b1985f5cd4e0', 
 +     'tool_consumer_instance_name': 'EL MML', 
 +     'tool_consumer_instance_description': 'e-Learning of MML', 
 +     'launch_presentation_document_target': 'window', 
 +     'launch_presentation_return_url': 'https://el.mml.tuis.ac.jp/moodle/mod/lt​i/return.php?course=98&launch_container=​4&instanceid=10&sesskey=3KFd8j8MPC' 
 + } 
 + 
 +**** JupyterHub へのパラメータ送信 [#h7f6bcb7] 
 +- Moodleの外部ツールの設定で,「一般」の「さらに表示する」でカスタムパラメータを指定すると,JupyterHub に任意のパラメータを送れる. 
 +-- ''XXX=ZZZ'' と入力すると,上記方法で ''{'costom_xxx': 'ZZZ'}'' として受け取れる(キーは小文字化される). 
 + 
 + 
 +- 予約語 
 +-- next= 
 +#br 
 + 
 +*** [[JupyterHub]] が [[Moodle]] から受け取ったデータ [#uff7064e] 
 +- 一般的に認証モジュールが引数として受け取る値
 {  {
     'oauth_version': '1.0',      'oauth_version': '1.0',
Line 48: Line 115:
     'oauth_signature': 't+ctcGhvev5hDh/Tz21NOYFBw8s='      'oauth_signature': 't+ctcGhvev5hDh/Tz21NOYFBw8s='
 }  }
-#br 
-*** Jupyter 側での受け取り [#vd91a1e1] 
#br #br


トップ   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 5月翌月
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
<今日>

オンライン状況

76 人のユーザが現在オンラインです。 (9 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 76

もっと...

アクセスカウンタ

今日 : 880880880
昨日 : 1753317533175331753317533
総計 : 2346402323464023234640232346402323464023234640232346402323464023
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com