在创建“登录”页面时,到目前为止,我已经完成了以下步骤:
所以我目前有一个session_token
。接下来,我需要通过API令牌创建会话。我根据这样的文档发出请求:
endpoint: https://test-dev.onelogin.com/session_via_api_token,
config: {
data: {
"session_token": session_token
},
method: 'post',
headers: {
'Content-Type': 'application/json',
},
},
但是在响应中收到此信息
Set-Cookie: sub_session_onelogin.com=BAh7ESIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7ACIfYnJvd3Nlcl92ZXJpZmljYXRpb25fdG9rZW4iRTRmNDVmNDg0MDAzYWU1NWMyNjZmNTBiODViMzA1ZDE4MTk3N2NhMzdhYWQ2ODkyYTViNGQ3NjA1ODIzMjA2ZjI6FGxvZ2luX2NvbXBsZXRlZFQ6D3Nlc3Npb25faWQiKTNkZjM5YjZiLTZiNTYtNDY4OC04ZTRjLWEyZDZhMDNkNGU2NzoQZnJvbV9vcGVuaWRGOhRzYW1sX3Nlc3Npb25faWQiKWE2OTQ3OWQwLTc2ZjItMDEzNi05NjViLTAyNTY0MzA2YzlkYzoPY3JlYXRlZF9hdEl1OglUaW1lDe2bHYDj9ZFYBjofQG1hcnNoYWxfd2l0aF91dGNfY29lcmNpb25GOhVzYW1sX3NlcnZpY2VfaWRzWwZpBBqk3gs6EF9jc3JmX3Rva2VuIjFoelh4QW5kS2Z4eUUrWEtrMjN6MzhscmpzT0hKUDdwa3Q3V0p4ditzeXhjPToJdXNlcmkE6Kd0AjoRbGFzdF9yZXF1ZXN0SXU7DA3umx2AmrBoGQY7DUY6DnJldHVybl90byIfaHR0cDovL2xvY2FsaG9zdDozMDAwL2F1dGg%3D--1b76462660c9758f487f04d34a8b016c450efd88;
Set-Cookie: onelogin.com_user=98d32096a699933b18f42a78835c0eaf9fdb9bdf;
我希望获得session_id。这是> sub_session_onelogin.com