Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How do i autheticate vanilla users outside vanilla framework
Aolee
✭✭
Hi guys
cant seem to find any thread related to my case but i found this one instead.
sorry this is a super old thread but its related to what i need
http://vanillaforums.org/discussion/3511/authenticating-a-vanilla-user-from-outside-the-vanilla-frameworks/p1
how do i do this in vanilla 2?
thanks in advance!
cant seem to find any thread related to my case but i found this one instead.
sorry this is a super old thread but its related to what i need
http://vanillaforums.org/discussion/3511/authenticating-a-vanilla-user-from-outside-the-vanilla-frameworks/p1
how do i do this in vanilla 2?
thanks in advance!
0
Comments
Paste your cookie salt from your config.php into that file and it doesn't even require calling up Vanilla. It's stand-alone.
Big thanks.
I'll add your recipe to special page about authentification.
I hope i can write a classified ads application (something like "open classifieds") someday for vanilla.
Hi lincon,
i tested it but the class doesn't return the Id,
i did a print_r and it returned me the public variables instead
VanillaIdentity Object ( [CookieName] => Vanilla [CookieSalt] => <value of salt here> [CookieHashMethod] => md5 )
by the way i was getting a syntax error in line 10 so i changed
class VanillaIdentity() {
to
class VanillaIdentity {
Are you instantiating the class? It should be used as:
$UserID = new VanillaIdentity();
What the heck am I smoking. Updated. Do this:
$Identity = new VanillaIdentity();
echo $Identity->UserID;
sorry for the inconvenience...
After i logged-in and went to the stand alone page (via another tab) it gave me 0 value?
even if i change login in and do a refresh on the stand alone page it also gave me 0.
thanks
just got back from a vacation, the page is in sub.domain.com while the vanilla framework is in www.domain.com
sub.domain.com docu root => /html/sub/
www.domain.com docu root => /html/vanilla/
by the way just a question
since my page is a standalone page (without any PHP included files)
where does the static call "Gdn_CookieIdentity::_HashHMAC" in the code comes from?
protected static function _Hash($Data, $CookieHashMethod, $CookieSalt) { return Gdn_CookieIdentity::_HashHMAC($CookieHashMethod, $Data, $CookieSalt); }
thanks
They need to be on the same subdomain, or your forum needs to set all-subdomain cookies. (*.domain.com)