Flutterのサード・ステップ2
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
「[[.NET 開発基盤部会 Wiki>http://dotnetdevelopmentinfras...
-[[戻る>Flutter]]
--...[[Flutterの5thステップ]]
--[[Flutterのファースト・ステップ2]]
--[[Flutterのセカンド・ステップ2]]
--Flutterのサード・ステップ2
*目次 [#g1dc9c7a]
#contents
*概要 [#mc2d02da]
OAuth系認証・認可処理を実装
*詳細 [#u588d16a]
[[以前のバージョンではAppAuthで認証処理を実装していたが>F...
Windowsデスクトップ版を実装するにあたり問題が発生して、自...
**フォルダ構成 [#c43b6070]
ヘッダにボタンを用意して、認証処理を...に実装する。
**カスタムURLスキーム [#ud464fdb]
Windowsデスクトップ版でというのがポイント
***EXEの位置 [#r0b5cb7c]
以下の辺りにEXEがある。
\flutter_template\build\windows\x64\runner\Debug
***レジストリ登録 [#f47c687f]
-登録内容
HKEY_CLASSES_ROOT\
myapp\
(Default) = "URL:myapp Protocol"
URL Protocol = ""
shell\
open\
command\
(Default) = "C:\path\to\your\app.exe" "%1"
-登録処理(PowerShell)
--登録
# register_scheme.ps1
$scheme = "myapp"
$exePath = "C:\Path\To\YourApp.exe" # 実際のパスに変更
$keyPath = "HKCU:\Software\Classes\$scheme"
New-Item -Path $keyPath -Force | Out-Null
Set-ItemProperty -Path $keyPath -Name "(Default)" -Value...
Set-ItemProperty -Path $keyPath -Name "URL Protocol" -Va...
New-Item -Path "$keyPath\shell\open\command" -Force | Ou...
Set-ItemProperty -Path "$keyPath\shell\open\command" -Na...
Write-Host "登録完了: $scheme://"
--解除
# unregister_scheme.ps1
$scheme = "myapp"
$keyPath = "HKCU:\Software\Classes\$scheme"
if (Test-Path $keyPath) {
Remove-Item -Path $keyPath -Recurse -Force
Write-Host "解除完了: $scheme://"
} else {
Write-Host "登録が見つかりません: $scheme://"
}
***ハンドラ [#he5a0ec1]
**インストール [#haf755e2]
flutter pub add flutter_appauth
*参考 [#v0d77f1a]
-FrontendTemplates/UI/XPlat at develop · OpenTouryoProjec...
https://github.com/OpenTouryoProject/FrontendTemplates/tr...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
終了行:
「[[.NET 開発基盤部会 Wiki>http://dotnetdevelopmentinfras...
-[[戻る>Flutter]]
--...[[Flutterの5thステップ]]
--[[Flutterのファースト・ステップ2]]
--[[Flutterのセカンド・ステップ2]]
--Flutterのサード・ステップ2
*目次 [#g1dc9c7a]
#contents
*概要 [#mc2d02da]
OAuth系認証・認可処理を実装
*詳細 [#u588d16a]
[[以前のバージョンではAppAuthで認証処理を実装していたが>F...
Windowsデスクトップ版を実装するにあたり問題が発生して、自...
**フォルダ構成 [#c43b6070]
ヘッダにボタンを用意して、認証処理を...に実装する。
**カスタムURLスキーム [#ud464fdb]
Windowsデスクトップ版でというのがポイント
***EXEの位置 [#r0b5cb7c]
以下の辺りにEXEがある。
\flutter_template\build\windows\x64\runner\Debug
***レジストリ登録 [#f47c687f]
-登録内容
HKEY_CLASSES_ROOT\
myapp\
(Default) = "URL:myapp Protocol"
URL Protocol = ""
shell\
open\
command\
(Default) = "C:\path\to\your\app.exe" "%1"
-登録処理(PowerShell)
--登録
# register_scheme.ps1
$scheme = "myapp"
$exePath = "C:\Path\To\YourApp.exe" # 実際のパスに変更
$keyPath = "HKCU:\Software\Classes\$scheme"
New-Item -Path $keyPath -Force | Out-Null
Set-ItemProperty -Path $keyPath -Name "(Default)" -Value...
Set-ItemProperty -Path $keyPath -Name "URL Protocol" -Va...
New-Item -Path "$keyPath\shell\open\command" -Force | Ou...
Set-ItemProperty -Path "$keyPath\shell\open\command" -Na...
Write-Host "登録完了: $scheme://"
--解除
# unregister_scheme.ps1
$scheme = "myapp"
$keyPath = "HKCU:\Software\Classes\$scheme"
if (Test-Path $keyPath) {
Remove-Item -Path $keyPath -Recurse -Force
Write-Host "解除完了: $scheme://"
} else {
Write-Host "登録が見つかりません: $scheme://"
}
***ハンドラ [#he5a0ec1]
**インストール [#haf755e2]
flutter pub add flutter_appauth
*参考 [#v0d77f1a]
-FrontendTemplates/UI/XPlat at develop · OpenTouryoProjec...
https://github.com/OpenTouryoProject/FrontendTemplates/tr...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
--https://github.com/OpenTouryoProject/FrontendTemplates/...
ページ名: