How to integrate *SAML-Jackson* using custom UI i...
# support-questions
s
How to integrate SAML-Jackson using custom UI in frontend using supertoken-web-js? it would be great if there is any example
r
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
yes that also might come in future.
r
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
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
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
Okay Understood, and URL will also be based on API endpoint correct?
r
yes. Just like in case of google.
s
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
Right. How have you configured SAML? Have you created a tenant in there?
r
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
I have used : front-end's localhost URL e.g. http://localhost:3000
r
can you tell me the exact value that you used? And can you paste the full URL thats returned from the getAuthorisationUrl function?
r
shouldnt the redirect_uri be localhost:3000/auth/callback/?
like for google it is localhost:3000/auth/callback/google
r
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
yeah
Let me generate it again and check
r
ok
s
now this login screen came. but after clicking on login. Redirect URL is not allowed
r
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
sure
F.E
BE
SAML-Jackson
r
ok thanks. @sattvikc can help here
s
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
So if i change in .sh file do I have to kill the docker container and run it again?
s
no need to restart the container
s
Okay
same
s
how did u create the encodedRawMetadata ?
s
I converted xml to base64
s
did u download a new metadata ?
s
yes
s
from mocksaml.com ?
s
yeah
s
give me a little while, let me try it out and get back.
s
Okay sure
Thanks
s
can u share the command u used to start the boxy container ?
s
- downloaded the repo. - npm run dev - ./addTenant.sh xyz.com
above steps I did to start SAML Container
s
ok so u r running the npm version of the boxy
s
yes
s
I just tried from the repo.. everything works out of the box. shall we get on a call to investigate this ?
s
s
yep, that's what I tried
s
ohh okay
s
can take a look at it over a call.. it will be a bit easier
s
okay
s
@ 3.15pm (IST) works for u ?
s
Can we connect after 4?
s
sure
s
can we connect?
s
yea sure
To join the video meeting, click this link: https://meet.google.com/woe-rjuw-tcn
s
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
do you see state value on the callback URL ?
s
yeah I am getting the code
s
what about
state
yeah state is also there
s
can u inspect the localstorage and see if u have the state object ?
s
lmc
local storage is blank
s
is there any change in the way you do the login redirect
seems like u may not have called getAuthURLAndSetState
s
okay where should I call it. before signupin API?
s
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
sure just a moment
Hey @sattvikc , things are working fine now. some jackson URL issue was there. Thanks
s
oh great!
p
@shrey07 Is you SAML integration working fine?
I tried and getting some errors @rp
r
are you using yarn? or npm version <= 7?
p
npm 9.3.1
r
@porcellus can help here
p
using the sample app to check the integration feature
p
hi, which example app is this?
p
right, so you completed the quick setup of the frontend, right?
what was/is the output of
npm i supertokens-auth-react
?
p
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
right, so you are not installing yourself, but running them via docker?
or which npm commands are you talking about?
p
npm i -s supertokens-auth-react
yeah via docker, I used the command npm run dev I followed the README file
p
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
yeah I mentioned auth-react and node too
okkh, please let me know how to resolve this one
p
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
I deleted the repo itself, and cloned it again, but still the issue persists
p
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
okk, giving it a try again
@porcellus Thanks it worked!!
2 Views