nabeel4628
03/10/2023, 2:15 PMthirdpartypasswordless
recipe , in golang
backend sdk (with gin framework)
now, in the refresh session flow, the call to core at /recipe/session/refresh
from the golang-sdk is breaking
i.e., for i tried manually calling supertokens core via cURL with:
curl --request POST 'http://supertokens:3567/recipe/session/refresh' --header 'api-key: <api-key here>' --header 'rid: session' --header 'content-type: application/json; charset=utf
-8' --header 'cdi-version: 2.14' --data-raw '{"refreshToken": "<refresh token here>", "enableAntiCsrf": false}'
the response returned by core is
{"status":"UNAUTHORISED","message":"java.lang.IllegalArgumentException: Illegal base64 character 25"}
So any help would be appreciated
PS: when I tried the refresh flow locally, with docker image of supertokens core ran locally, the same call to /recipe/session/refresh
via golang-skd is getting response OK (with the same sdk version of supertokens in golang)rp_st
03/10/2023, 2:48 PMrp_st
03/10/2023, 2:48 PMnabeel4628
03/10/2023, 2:51 PMrp_st
03/10/2023, 2:51 PMrp_st
03/10/2023, 2:51 PMrp_st
03/10/2023, 2:51 PMnabeel4628
03/10/2023, 2:52 PMnabeel4628
03/10/2023, 3:17 PMrp_st
03/10/2023, 3:17 PMnabeel4628
03/10/2023, 3:22 PMrp_st
03/10/2023, 3:23 PMnabeel4628
03/10/2023, 3:25 PMimage:
repository: supertokens/supertokens-postgresql
pullPolicy: IfNotPresent
# -- Overrides the image tag whose default is the chart appVersion.
tag: "3.14"
rp_st
03/10/2023, 3:25 PMnabeel4628
03/10/2023, 3:26 PMregistry.supertokens.io/supertokens/supertokens-postgresql
registry without mentions of any versionrp_st
03/10/2023, 3:26 PMnabeel4628
03/10/2023, 3:26 PMrp_st
03/10/2023, 3:28 PMrp_st
03/10/2023, 3:29 PMnabeel4628
03/10/2023, 3:31 PMrp_st
03/10/2023, 3:31 PMnabeel4628
03/10/2023, 3:36 PMrp_st
03/10/2023, 3:39 PMnabeel4628
03/10/2023, 3:41 PM10 Mar 2023 15:38:45:525 +0000 | DEBUG | pid: 26cb8ae2-f561-4bd5-98de-242043cb19bc | [http-nio-0.0.0.0-3567-exec-8] thread | io.supertokens.webserver.WebserverAPI.service(WebserverAPI.java:157) | API called: /recipe/session/refresh. Method: POST. Version: 2.14
10 Mar 2023 15:38:46:039 +0000 | DEBUG | pid: 26cb8ae2-f561-4bd5-98de-242043cb19bc | [http-nio-0.0.0.0-3567-exec-8] thread | io.supertokens.webserver.WebserverAPI.service(WebserverAPI.java:182) | API ended: /recipe/session/refresh. Method: POST
nabeel4628
03/10/2023, 3:41 PMnabeel4628
03/10/2023, 3:41 PMrp_st
03/10/2023, 3:41 PMrp_st
03/10/2023, 3:42 PMrp_st
03/10/2023, 3:42 PMnabeel4628
03/10/2023, 3:43 PMnabeel4628
03/10/2023, 4:05 PMrp_st
03/10/2023, 4:40 PMrp_st
03/10/2023, 4:41 PMnabeel4628
03/13/2023, 6:25 AMrp_st
03/13/2023, 7:20 AMnabeel4628
03/14/2023, 11:10 AMauth/session/refresh
endpoint (which is exposed via supertokens sdk itself) from postman, it was not sending the sRefreshToken cookie in the request (reason being , the path of that cookie was set to Path=/auth/session/refresh
on the successful signin/up) however, we changed it to Path=/
and it started working.
however, supertokens frontend sdk too, is not sending the sRefreshToken cookie due to this path reason i believe , hence it is showing error
cc @anupamnabeel4628
03/14/2023, 11:14 AMcurl --request POST 'http://supertokens:3567/recipe/session/refresh' --header 'api-key: <api-key here>' --header 'rid: session' --header 'content-type: application/json; charset=utf-8' --header 'cdi-version: 2.14' --data-raw '{"refreshToken": "<refresh token here>", "enableAntiCsrf": false}'
but it was failing on both, local docker and kubernetes on cloud
with error message as :
{
"status": "UNAUTHORISED",
"message": "java.lang.IllegalArgumentException: Illegal base64 character 25"
}
nabeel4628
03/14/2023, 11:16 AMrp_st
03/14/2023, 12:19 PManupam
03/15/2023, 5:12 AM/auth/session/refresh
and our backend api url is /appname/auth/session/refresh
.rp_st
03/15/2023, 5:18 AM/appname
part get stripped away by something by the time it reaches the actual server code?
If so, then you need to add the /appname
as the apiGatewayPath
on the backend's appInfo, and set the apiBasePath
to /auth
on the backend.
On the frontend, you need to set the apiBasePath
to /appname/auth
.nabeel4628
03/15/2023, 6:32 AMrp_st
03/15/2023, 6:53 AM