Can I send data from an external page to the vanilla login page?

Hi, I want to input my login credentials on my external page, and after submitting, I want the data to appear on the vanilla forum page.
Best Answers
-
x00 MVP
with jQuery
<div id="sign_in_form"></div> <script> var url_to_forum = 'http://somesite.com/forum'; // set you url here. // load sign in form $( '#sign_in_form').load( url_to_forum + '/entry/signin?DeliveryType=VIEW #Form_User_SignIn', function(){ // make action url absolute. var form = $( '#sign_in_form #Form_User_SignIn'); form.attr('action', url_to_forum + form.attr('action')); }); </script>
presuming it is on the same domain.
grep is your friend.
6 -
kudeta21 New
@R_J said:
I'm no JavaScript guy but here is a working example for curl: https://vanillaforums.org/discussion/comment/240977/#Comment_240977You would have to do the same steps in JavaScript:
1. GET request the signin page
2. extract TransientKey and ClientHour
3. make a POST request with the fields mentioned in the linked comment
4. based on the result of the request you would know if the login was successfulBut what I do not understand is that you say that your page is a static page. To my understanding a static page contains all information and doesn't fetch additional information from a server.
Since the page already contains all information, anyone would be able to see everything by just inspecting the html source code. Why do you need a authentication?yes it is a static since it has all the information, i just need to login through that homepage rather than redirecting to sign in page
@x00 said:
with jQuery<div id="sign_in_form"></div> <script> var url_to_forum = 'http://somesite.com/forum'; // set you url here. // load sign in form $( '#sign_in_form').load( url_to_forum + '/entry/signin?DeliveryType=VIEW #Form_User_SignIn', function(){ // make action url absolute. var form = $( '#sign_in_form #Form_User_SignIn'); form.attr('action', url_to_forum + form.attr('action')); }); </script>
presuming it is on the same domain.
thanks for helping! it's working.
5
Answers
Yes, but that would probably be a poor implementation.
What exactly are you trying to achieve?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I want to register or login thru my homepage .
You are looking for single sign on (SSO). Vanilla offers jsConnect libraries for software that isn't already supported.
Is your homepage custom software?
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Yes it is custom, but it has no database. it a static page. I want to use the forums database.
Ok, you can just request the sign in form via JS and then they post directly to the forum complete with transient key.
http://forums.example.com/entry/signin?DeliveryType=VIEW
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I'm sorry I'm too noob to this
can you tell me how?
That depends.. If I understand you correctly, you want to use this page as a landing page of your website and you want to add a link to the vanilla sign in form from that page ?
You could add a link that opens the sign in form. It will redirect the page to the forum once logged in.
Or do you want to add a sign in form to that page ?
❌ ✊ ♥. ¸. ••. ¸♥¸. ••. ¸♥ ✊ ❌
as of now, i add a link to the vanilla sign in page. but I want to add a sign in form to the landing page
I'm no JavaScript guy but here is a working example for curl: https://vanillaforums.org/discussion/comment/240977/#Comment_240977
You would have to do the same steps in JavaScript:
1. GET request the signin page
2. extract TransientKey and ClientHour
3. make a POST request with the fields mentioned in the linked comment
4. based on the result of the request you would know if the login was successful
But what I do not understand is that you say that your page is a static page. To my understanding a static page contains all information and doesn't fetch additional information from a server.
Since the page already contains all information, anyone would be able to see everything by just inspecting the html source code. Why do you need a authentication?
with jQuery
presuming it is on the same domain.
grep is your friend.
yes it is a static since it has all the information, i just need to login through that homepage rather than redirecting to sign in page
thanks for helping! it's working.