Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Automatic login via GET


Go to End


3 Posts   879 Views

Avatar
jkdude

Community Member, 19 Posts

16 April 2015 at 2:05am

Hi everyone,

I was wondering if anyone could help point me in the right direction for implementing automatic login via url.

I would like to create a generic user account that only has View privileges so that they can see draft pages, without the need for them to have to login via the login page. Is there a way for me to do this?

Thanks,
JK

Avatar
swaiba

Forum Moderator, 1899 Posts

16 April 2015 at 3:27am

I recall this being part of 2.4, but I think it has been discontinued for very sound security reasons.
However there is nothing to stop you doing this based on your own security requirements... at the end of the day you need to identify a Member and call the login function only.... Member->get()->first()->logIn();

But I wouldn't advise any of this and instead provide whatever is required after normal authentication, or provide it publically with some other obfuscation like a large random url

Avatar
jkdude

Community Member, 19 Posts

18 April 2015 at 2:40pm

Thanks for the advice Swaiba.