The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

sso for non auth users

swensorswensor Member
in Bugs & Feature Requests edited March 2010
hey all,

so i am doing sso on a store. it works great, nice feature. i want to be able to allow users to sign up and check out without authorization still, however. is this even possible with sso? i want an authorized user to be logged in automatically, but for new users, i want them to go through the process of account creation in foxy carts sexy ajax'd method of check out. it seems like there is no way to do this. am i doing it wrong? thanks!

swensor
Comments
  • brettbrett FoxyCart Team
    Yeah, perhaps you're missing something or the docs aren't clear, but you can pass in a user of 0 and it'll assume it's a new user.

    http://wiki.foxycart.com/docs:single_sign_on
    ... yeah, hidden here:
    fc_customer_id: INTEGER. The customer ID, as determined and stored when the user is first created or synched using the API. NOTE: If a customer is not authenticated and you would like to allow them through to checkout, enter a customer ID of 0 (the number).
    That what you're after?
  • yes definitely! thanks a bunch I should have read the documentation more thoroughly, it seems. sorry to be a noob!

    thanks again.
  • brettbrett FoxyCart Team
    No worries. There's a lot to FoxyCart under the surface.
  • Hey Brett,

    n00b #2 here...

    Sorry for being daft, but how do I get the FoxyCart customer ID for my SSO endpoint script? On line 42 of the wiki "starter script" for the endpoint, it asks for a "database query or session variable" for the current user's FoxyCart customer ID. The docs say I can get this by synching with the API...but that statement may as well be in Armenian.

    The script itself seems to be set up correctly -- when I keep the default customer ID in the endpoint and head over to checkout, it redirects ok and tells me I'm already logged in (but no email is populated).

    Good chance I'm digging the wrong hole. Would anyone here mind pointing me in the right direction?
  • brettbrett FoxyCart Team
    @vossavant Are you rolling your own SSO integration? If so, what are you doing for creating/synching users between your system and FoxyCart? That's kind of the key. To use the SSO you need to pass in which user you're actually dealing with, which will (likely) require some API integration on your end.

    http://wiki.foxycart.com/docs:api

    The API and the SSO stuff are definitely not "beginner" things, so we'll help as much as we can but be prepared to dig in a little and learn some new skills.
  • Hey Brett,

    Hmm...I may not be doing this the best way. I *am* rolling my own integration via WordPress. Currently, when a user places an order, I have my datafeed script grab the datafeed, pull out the info, and check the customer email in the datafeed against emails in the WP database. If the email already exists in the DB, the user exists, so don't duplicate. Else, create a new user, dumping in all info contained in the datafeed.

    The order info is then assigned to that particular user and generated as a WP post, so I can easily view all previous orders via the WP control panel.

    Presently, I am not offering the user any way of updating his profile, and there is not yet any synching of users between my system and FoxyCart.

    The API docs don't make much sense to me...yet. I'll give them another look when I'm fresh rather than bug you guys with uninformed questions :)
  • brettbrett FoxyCart Team
    Nah, they're good questions. I guess the question goes back to your original, which is "how to get the FoxyCart user ID. I'd grab it from the XML and store it on the user's record, possibly by simply adding another column to your user database table. Then your SSO endpoint can see the currently logged in user (in WP, on your end), and grab their corresponding FC ID to pass back to FoxyCart.

    Let us know how it goes.
Sign In or Register to comment.