TokenMismatchException in VerifyCsrfToken.php line 67: How to get token

0

I try to save a note through the Store method with a request POST to the path /categorias , if I log in the system works correctly, but I have no idea how to do it through of PostMan, I understand that it will never be possible because I must be authenticated before I can do it.

The intention of all this is that I want to do it from an App in android sending the request by the URI and as I realize I need to send the token .. but I have no idea how to get the user's token or how to send it.

Route

Route::group(['middleware'=>'auth'], function(){
    Route::resource('/categorias','NoteController');
});

Driver

public function store()
{
    $note = new Note();
    try {
        $note->text = 'Primera Nota';
        $note->user_id = Auth::user()->id();
        Log::info('Nota Creata');
    } Catch (\Exception $e) {
        Log::critical('Erro al registrar la nota');
    }
}

PDT: I try to login with postman to the path /login by sending the parameters email,password as the login form of laravel has them and I realize that it has a hidden attribute <input type="hidden" name="_token" value="'.csrf_token().'"> that I do not know how to send it in the request: (

    
asked by jeancarlos733 02.06.2017 в 23:55
source

1 answer

0

When logging in for the first time you should return the Token to the application and use it for other operations.

You can use JWT-Auth to get the tokens. Here is more information about this: link

    
answered by 03.06.2017 в 01:06