https://supertokens.com/ logo
#support-questions
Title
# support-questions
s

shrey07

12/27/2022, 1:17 PM
How to integrate SAML-Jackson using custom UI in frontend using supertoken-web-js? it would be great if there is any example
r

rp

12/27/2022, 1:42 PM
hey @shrey07 You can follow the docs for the integrating with google sign in using web-js - it's the same thing with SAML as well.
are you planning on having different tenants?
s

shrey07

12/27/2022, 1:43 PM
yes that also might come in future.
r

rp

12/27/2022, 1:44 PM
right. So multi tenancy is a paid feature. I'd be happy to walk you through this setup with web-js over a call (since we don't have any docs for it)
you can pick a time you like here: https://supertokens.com/call-user
s

shrey07

12/27/2022, 1:48 PM
I have a few doubts while using the google sign-in using web-js, what will be the provider Id for SAML will it depend on the service we are using for SAML?
r

rp

12/27/2022, 1:49 PM
no. Provider ID will be the same thing that you configure on the backend for SAML (the
id
field on the backend's custom provider config)
s

shrey07

12/27/2022, 1:54 PM
Okay Understood, and URL will also be based on API endpoint correct?
r

rp

12/27/2022, 1:55 PM
yes. Just like in case of google.
s

shrey07

12/27/2022, 1:56 PM
Okay understood. Thanks
@rp , I have added CORS and added redirect url in mock-saml-metadata.xml as well. but still getting not valid redirect URL
r

rp

12/27/2022, 2:47 PM
Right. How have you configured SAML? Have you created a tenant in there?
r

rp

12/27/2022, 5:12 PM
right. So I assume that you ran the curl command to create a new tenant in boxy hq
in that case, what
redirectUrl
and what
defaultRedirectUrl
did you use?
s

shrey07

12/28/2022, 4:40 AM
I have used : front-end's localhost URL e.g. http://localhost:3000
r

rp

12/28/2022, 5:28 AM
can you tell me the exact value that you used? And can you paste the full URL thats returned from the getAuthorisationUrl function?
r

rp

12/28/2022, 6:26 AM
shouldnt the redirect_uri be localhost:3000/auth/callback/?
like for google it is localhost:3000/auth/callback/google
r

rp

12/28/2022, 6:31 AM
can i see the curl command that you had given to SAML server?
this seems fine now. Im not sure why it's not allowing it.
Have you added the right client id and secret on the backend?
(the result of the curl command)
s

shrey07

12/28/2022, 6:51 AM
yeah
Let me generate it again and check
r

rp

12/28/2022, 6:53 AM
ok
s

shrey07

12/28/2022, 7:08 AM
now this login screen came. but after clicking on login. Redirect URL is not allowed
r

rp

12/28/2022, 7:09 AM
can i see all the things you have done? The curl command, the backend custom provider, the frontend function calls
probably some silly mistake somewhere
s

shrey07

12/28/2022, 7:10 AM
sure
F.E
BE
SAML-Jackson
r

rp

12/28/2022, 7:13 AM
ok thanks. @sattvikc can help here
s

sattvikc

12/28/2022, 7:13 AM
lemme check in a moment
could you make redirectUrl and defaultRedirect url same and try again ?
it should point to localhost:3000/auth/callback/saml-jackson
s

shrey07

12/28/2022, 7:20 AM
So if i change in .sh file do I have to kill the docker container and run it again?
s

sattvikc

12/28/2022, 7:21 AM
no need to restart the container
s

shrey07

12/28/2022, 7:21 AM
Okay
same
s

sattvikc

12/28/2022, 7:26 AM
how did u create the encodedRawMetadata ?
s

shrey07

12/28/2022, 7:27 AM
I converted xml to base64
s

sattvikc

12/28/2022, 7:27 AM
did u download a new metadata ?
s

shrey07

12/28/2022, 7:27 AM
yes
s

sattvikc

12/28/2022, 7:27 AM
from mocksaml.com ?
s

shrey07

12/28/2022, 7:28 AM
yeah
s

sattvikc

12/28/2022, 7:29 AM
give me a little while, let me try it out and get back.
s

shrey07

12/28/2022, 7:29 AM
Okay sure
Thanks
s

sattvikc

12/28/2022, 7:30 AM
can u share the command u used to start the boxy container ?
s

shrey07

12/28/2022, 7:31 AM
- downloaded the repo. - npm run dev - ./addTenant.sh xyz.com
above steps I did to start SAML Container
s

sattvikc

12/28/2022, 7:32 AM
ok so u r running the npm version of the boxy
s

shrey07

12/28/2022, 7:32 AM
yes
s

sattvikc

12/28/2022, 7:49 AM
I just tried from the repo.. everything works out of the box. shall we get on a call to investigate this ?
s

shrey07

12/28/2022, 8:51 AM
s

sattvikc

12/28/2022, 8:52 AM
yep, that's what I tried
s

shrey07

12/28/2022, 8:52 AM
ohh okay
s

sattvikc

12/28/2022, 8:54 AM
can take a look at it over a call.. it will be a bit easier
s

shrey07

12/28/2022, 8:57 AM
okay
s

sattvikc

12/28/2022, 8:57 AM
@ 3.15pm (IST) works for u ?
s

shrey07

12/28/2022, 9:08 AM
Can we connect after 4?
s

sattvikc

12/28/2022, 9:08 AM
sure
s

shrey07

12/28/2022, 10:39 AM
can we connect?
s

sattvikc

12/28/2022, 10:39 AM
yea sure
To join the video meeting, click this link: https://meet.google.com/woe-rjuw-tcn
s

shrey07

12/30/2022, 6:00 AM
Hi @sattvikc, After successful configuration to SAML Jackson. while I am calling ThirdPartyEmailPassword.thirdPartySignInAndUp from the callback route I am getting the error mentioned in the ss. let me know If I am missing anything here.
s

sattvikc

12/30/2022, 6:02 AM
do you see state value on the callback URL ?
s

shrey07

12/30/2022, 6:02 AM
yeah I am getting the code
s

sattvikc

12/30/2022, 6:03 AM
what about
state
yeah state is also there
s

sattvikc

12/30/2022, 6:05 AM
can u inspect the localstorage and see if u have the state object ?
s

shrey07

12/30/2022, 6:05 AM
lmc
local storage is blank
s

sattvikc

12/30/2022, 6:06 AM
is there any change in the way you do the login redirect
seems like u may not have called getAuthURLAndSetState
s

shrey07

12/30/2022, 6:08 AM
okay where should I call it. before signupin API?
s

sattvikc

12/30/2022, 6:08 AM
no
it's needs to be called in the handle SignIn clicked
I think you had automatic redirect right ?
can you show me your frontend code where you do the redirect part ?
SignInUp is fine
s

shrey07

12/30/2022, 6:10 AM
sure just a moment
Hey @sattvikc , things are working fine now. some jackson URL issue was there. Thanks
s

sattvikc

12/30/2022, 11:35 AM
oh great!
p

paras

02/28/2023, 5:36 AM
@shrey07 Is you SAML integration working fine?
I tried and getting some errors @rp
r

rp

02/28/2023, 9:29 AM
are you using yarn? or npm version <= 7?
p

paras

02/28/2023, 9:30 AM
npm 9.3.1
r

rp

02/28/2023, 9:30 AM
@porcellus can help here
p

paras

02/28/2023, 9:31 AM
using the sample app to check the integration feature
p

porcellus

02/28/2023, 9:38 AM
hi, which example app is this?
p

porcellus

02/28/2023, 9:40 AM
right, so you completed the quick setup of the frontend, right?
what was/is the output of
npm i supertokens-auth-react
?
p

paras

02/28/2023, 9:41 AM
I wen't through that also and made created an app, but this one is independent app(i.e sample app)
The two npm commands for BE and BE ran successfully
p

porcellus

02/28/2023, 9:50 AM
right, so you are not installing yourself, but running them via docker?
or which npm commands are you talking about?
p

paras

02/28/2023, 10:05 AM
npm i -s supertokens-auth-react
yeah via docker, I used the command npm run dev I followed the README file
p

porcellus

02/28/2023, 10:10 AM
ah I see. the guide never mentions installing supertokens-auth-react though.
I'm checking this out, but this may have caused an update that's not compatible with the old version of npm (and node) used in the docker images
p

paras

02/28/2023, 10:13 AM
yeah I mentioned auth-react and node too
okkh, please let me know how to resolve this one
p

porcellus

02/28/2023, 10:16 AM
I think the quickest thing is if you revert changes to all of the
package.json
, remove
package-lock.json
files and re-build the containers
also remove the node_modules
p

paras

02/28/2023, 10:18 AM
I deleted the repo itself, and cloned it again, but still the issue persists
p

porcellus

02/28/2023, 10:22 AM
so the process was: 1. clone the example repo 2. run
npm run dev
/
yarn dev
nothing between?
can you maybe post a log? I did just those steps and it seemed to be working for me.
p

paras

02/28/2023, 10:28 AM
okk, giving it a try again
@porcellus Thanks it worked!!
2 Views