Hi Guys, I am trying to make hydra (hosting on my...
# ory-network
q
Hi Guys, I am trying to make hydra (hosting on my server) work with kratos cloud. But when I am calling
whoami
api using Its failing as it needs
ory_kratos_session
cookie but kratos cloud returns
ory_sesssion_{project_id}
cookie so api fails. It returns unreadable message as well. I tried sending
ory_kratos_seesion
cookie using below code but error is same
Copy code
kratosClient
          .whoami(
            undefined,
            'ory_kratos_session=' + kratosSessionCookie,
            req as { headers: { [name: string]: string } }
          )
I am using hydra-integration-2021 branch from kratos-selfservice-node project
p
Hi @User We don't currently have a working example of Kratos Cloud and Hydra self-host. I think it is possible though with some tweaking. I will need to take a look to be able to answer you with what the problem is. Could you also direct me in what your setup is currently and which part of the code is giving your trouble (GH links preferred).
q
@User I am getting issue at this point https://github.com/ory/kratos-selfservice-ui-node/blob/hydra-integration-2021/src/routes/hydra.ts#L168 When we send req to
whoami
api I get unreadable response from that and it fails to get identity object
Copy code
whoami >>> M�~����r� Bu�}׼	����M�
]�%�%*ǎh����                  �RZ@m��tS.�pR�&��D���_��y}3.���Ws���
      `(�1�/�!U�λiN��$��pE��*�W�7������<�1m���آ�:;���a�MH�#V��ĕX�q�n�u*�6f�n0���+xPh�j\I)��ox��`�� i�x���R쭓���MG�qM�u����*�aLkl]!�!�x���C�a^����]��]My��s�c�4 ��Ė3�mfy䣁-�7���z�w�ar��?Ĉ?NPA.Xx���0�f0��|���KN��BjJ(3N%����x�8�|��0<k�V4l�� �E�Uj$�K`�e#�hBO0jN�Ҋ4uF�8�"B����Rv����W���[�z�?�4�w���}Otp��8q""�e��$�B�%v4V���~�C�Wk�4�ЏǓ
TypeError: Cannot read property 'id' of undefined
    at /home/zootopialover/kratos-selfservice-ui-node/src/routes/hydra.ts:189:43
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
This is the response I go from
whoami
api
I also tried setting Authorization header and assign value of ory_session_{project_id} cookie before seding request to
whoami
apibut that gives same ouput as above This is my headers
Copy code
headers {
  cookie: '_csrf=8IEALGKDylAoLB1UFUbVOnFB; connect.sid=s%3AX0eJEFtcCKZGMlrYsAXIOgcB_p1qKiDX.6DIw%2F1jOazX%2B3s9adsFgrz2iEesfh865fxDtRhQK808; csrf_token_eb7fd0866fd8188dbb4a7858c6e4eff0985bda5ae647e92e9e4ee08696e5ee5e=zgsiv5cgbsGGhOQc1QE72okbadR8BEhu6GFvs73H33A=; ory_session_hopefulcannonmxqwmpwo2g=MTY0NjY3ODM5NXxEdi1CQkFFQ180SUFBUkFCRUFBQVJfLUNBQUVHYzNSeWFXNW5EQThBRFhObGMzTnBiMjVmZEc5clpXNEdjM1J5YVc1bkRDSUFJRlZuYlZSek5FNWthR0UxZUdKMWVYbE1OSFJQWTJSek4xbENlVFV5T1UxWXwieQy6rWvvzDVcdMy2CPpGEXHA7nWYbUgOLwCC74-F6w==',
  Authorization: 'bearer MTY0NjY3ODM5NXxEdi1CQkFFQ180SUFBUkFCRUFBQVJfLUNBQUVHYzNSeWFXNW5EQThBRFhObGMzTnBiMjVmZEc5clpXNEdjM1J5YVc1bkRDSUFJRlZuYlZSek5FNWthR0UxZUdKMWVYbE1OSFJQWTJSek4xbENlVFV5T1UxWXwieQy6rWvvzDVcdMy2CPpGEXHA7nWYbUgOLwCC74-F6w=='
}
p
That's quite strange. Is the kratos base URL set correctly here?
q
yes I was able to get cookie session from kratos cloud
p
this might be a problem with the client you are using here
maybe try the
@ory/client
instead of
@oryd/kratos-client
q
ok i will try