secretMachineIdを追加することで複数セッション張ることが可能(今聞いた)
Closed this issue · 0 comments
kazu0617 commented
ここのログイン処理にsecretMachineId
を追加することで複数セッション張ることが可能。
MachineIdの判断条件としては以下の通り:
- 22文字
- 数字・英文字(Lowercase)・記号(
-
_
のみ)各種0個以上で構成
なので、極端な場合これでもOK。
POST https://{{hostname}}/api/userSessions HTTP/1.1
content-type: {{contentType}}
TOTP: {{totp}}
{
"ownerId": null,
"username": null,
"email": "{{email}}",
"password": "{{password}}",
"secretMachineId": "012345678901234567890",
"rememberMe": false
}
公式の実装としては:
- UUIDの生成
- ByteArrayに変換
- Base64 URL Encodingに変換( RFC4648)
3.1 Base64で実装した後、+
->-
|/
->_
|=
-> ``(空文字) - 全部小文字にする
といった具合です。