Podio Authentication - App AND User



1 comment

  • Andreas Haugstrup Pedersen

    Hi Patrick,

    Look at the authenticate method in the Podio class: https://github.com/podio/podio-php/blob/master/lib/Podio.php#L45

    You can see that after you call authenticate the $oauth class variable is set to contain the new authentication tokens, overwriting anything that may have been there before. In other words: Yes, you can only be authenticated as one entity at a time.

    To switch authentications you will need to do your own grunt work. Before switching authentication you must store the currently active authentication tokens somewhere else. You have full access to the $oauth variable so you can do whatever you want.

    When switching back you can simply restore the value of $oauth to your old tokens and you'll be authenticated as the old entity.

    So, yes, it's possible to make API calls as two different entities in the same request, but if you don't want to re-authenticate each time you switch you will have to do the grunt work yourself.

    You will also want to disable the built-in session manager as it will get confused if you switch authentication tokens around. See the last example here: https://github.com/podio/podio-php/blob/master/examples/session-manager.php

    All the best,


    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk