simple_token_authentication icon indicating copy to clipboard operation
simple_token_authentication copied to clipboard

How can I use data from a JSON to authenticate my user ?

Open gabrIbanez opened this issue 6 years ago • 0 comments

Hello,

I'm using a typeForm in my app. This is the Json it's sends to my API :

`Parameters: {"event_id"=>"LtWXD3crgy", "event_type"=>"form_response", "form_response"=>{"form_id"=>"lT4Z3j", "token"=>"a3a12ec67a1365927098a606107fac15", "submitted_at"=>"2018-01-18T18:17:02Z",

"hidden"=>{"source"=>"xxxxx", "user_email"=>"[email protected]", "user_token"=>"HbLYEWD7fbWk1DqMZJ3z"},

"landed_at"=>"2018-01-18T18:07:02Z", "calculated"=>{"score"=>9}, "definition"=>{"id"=>"lT4Z3j", "title"=>"Webhooks example", "fields"=>[{"id"=>"DlXFaesGBpoF", "title"=>"Thanks, {{answer_60906475}}! What's it like where you live? Tell us in a few sentences.", "type"=>"long_text", "ref"=>"[readable_ref_long_text", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"SMEUb7VJz92Q", "title"=>"If you're OK with our city management following up if they have further questions, please give us your email address.", "type"=>"email", "ref"=>"readable_ref_email", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"JwWggjAKtOkA", "title"=>"What is your first name?", "type"=>"short_text", "ref"=>"readable_ref_short_text", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"KoJxDM3c6x8h", "title"=>"When did you move to the place where you live?", "type"=>"date", "ref"=>"readable_ref_date", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"PNe8ZKBK8C2Q", "title"=>"Which pictures do you like? You can choose as many as you like.", "type"=>"picture_choice", "ref"=>"readable_ref_picture_choice", "allow_multiple_selections"=>true, "allow_other_choice"=>false}, {"id"=>"Q7M2XAwY04dW", "title"=>"On a scale of 1 to 5, what rating would you give the weather in Sydney? 1 is poor weather, 5 is excellent weather", "type"=>"number", "ref"=>"readable_ref_number1", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"gFFf3xAkJKsr", "title"=>"By submitting this form, you understand and accept that we will share your answers with city management. Your answers will be anonymous will not be shared.", "type"=>"legal", "ref"=>"readable_ref_legal", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"k6TP9oLGgHjl", "title"=>"Which of these cities is your favorite?", "type"=>"multiple_choice", "ref"=>"readable_ref_multiple_choice", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"RUqkXSeXBXSd", "title"=>"Do you have a favorite city we haven't listed?", "type"=>"yes_no", "ref"=>"readable_ref_yes_no", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"NRsxU591jIW9", "title"=>"How important is the weather to your opinion about a city? 1 is not important, 5 is very important.", "type"=>"opinion_scale", "ref"=>"readable_ref_opinion_scale", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"WOTdC00F8A3h", "title"=>"How would you rate the weather where you currently live? 1 is poor weather, 5 is excellent weather.", "type"=>"rating", "ref"=>"readable_ref_rating", "allow_multiple_selections"=>false, "allow_other_choice"=>false}, {"id"=>"pn48RmPazVdM", "title"=>"On a scale of 1 to 5, what rating would you give the general quality of life in Sydney? 1 is poor, 5 is excellent", "type"=>"number", "ref"=>"readable_ref_number2", "allow_multiple_selections"=>false, "allow_other_choice"=>false}]}}`

I'd like to use "hidden" witch contains user_token and user_mail to authenticate my user. What should I do ?

gabrIbanez avatar Jun 20 '18 05:06 gabrIbanez