Questions tagged [token]

A token is a string of characters, categorized according to the rules as a symbol (e.g., IDENTIFIER, NUMBER, COMMA). The process of forming tokens from an input stream of characters is called tokenization, and the lexer categorizes them according to a symbol type. A token can look like anything that is useful for processing an input text stream or text file.

A token is the smallest part of an input text with a meaning. A token may be a single character, a symbol, a word or anything that is useful for processing an input text. Tokens are used in processing programming languages or natural languages.

The process of forming tokens from an input stream is called tokenization or lexical analysis. A program or function which performs lexical analysis is called a lexical analyzer, lexer, or scanner.

7573 questions
30
votes
6 answers

Is an X-Requested-With header server check sufficient to protect against a CSRF for an ajax-driven application?

I'm working on a completely ajax-driven application where all requests pass through what basically amounts to a main controller which, at its bare bones, looks something like this: if(strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) ==…
Greg
  • 7,782
  • 7
  • 43
  • 69
29
votes
2 answers

how edge ngram token filter differs from ngram token filter?

As I am new to elastic search, I am not able to identify difference between ngram token filter and edge ngram token filter. How these two differ from each other in processing tokens?
Karunakar
  • 2,209
  • 4
  • 15
  • 20
28
votes
3 answers

Locust passing headers

Is it possible to have Locust pass a header command with a secure token to load test an API? I am trying to test our api for an encoder with a header flag for a token as the server being tested has to receive a token with the request, ie. curl -H…
Liam Douglas
  • 389
  • 1
  • 3
  • 3
28
votes
2 answers

Google Sign-In backend server authentication

I'm writing an Android app for voice chatting and decided to use Google Sign-In for a simple user authentication with my backend server. However, I don't understand how the app should authenticate with my backend. When a user signs-in using his…
Salivan
  • 1,876
  • 7
  • 26
  • 45
28
votes
3 answers

When do GCM Tokens Expire and What is the InstanceID?

Since GCM keeps getting updated, most of the resources I have searched seem outdated or unclear. Basically, I am confused over when the tokens and ID's expire. (For reference, I am working with Android.) From what I understand (and please correct me…
B. Roth
  • 359
  • 1
  • 3
  • 12
27
votes
5 answers

eBay oauth token and refresh tokens

been struggling for couple of days with eBay token authentication. I am finding it hard to understand how to fetch new tokens, after signing up for a developer program account, I requested the key-set and got them, afterwards I grant access on…
simultsop
  • 740
  • 1
  • 12
  • 31
27
votes
3 answers

Add authentication to OPTIONS request

How can I add headers to the OPTIONS request made towards a cross-domain API? The API I'm working against requires a JWT token set as Authorization header on all requests. When I try to access to the API Angular first performs an OPTIONS request…
Glenn Utter
  • 2,313
  • 7
  • 32
  • 44
27
votes
5 answers

How to extract and verify token sent from frontend

I am using "github.com/dgrijalva/jwt-go", and able to send a token to my frontend, and what I would like to know how I could retrieve the token sent from the frontend so that I can verify if the token that was sent is valid and if so the secured…
poise
  • 817
  • 1
  • 9
  • 16
27
votes
1 answer

How to implement 'Token Based Authentication' securely for accessing the website's resources(i.e. functions and data) that is developed in PHPFox?

I want to use methods and resources from the code of a website which is developed in PHPFox. Basically, I'll receive request from iPhone/Android, I'll get the request and pass to the respective function from the PHPFox code, take the response from…
PHPLover
  • 1
  • 51
  • 158
  • 311
26
votes
11 answers

Facebook graph API - OAuth Token

I'm trying to retrieve data using the new graph API, however the token I'm retriving from OAuth doesn't appear to be working. The call I'm making is as follows; $token =…
Simon R
  • 3,732
  • 4
  • 31
  • 39
26
votes
2 answers

Best way to create a TOKEN system to authenticate web service calls?

I'd like to create a web service architecture that can be called by various platforms such as mobile devices, winforms applications, iphone, blackberry, you name it. So going with something like WCF and wsHttp binding probably kills this and I…
Neal
  • 9,487
  • 15
  • 58
  • 101
26
votes
4 answers

Unix cut except last two tokens

I'm trying to parse file names in specific directory. Filenames are of format: token1_token2_token3_token(N-1)_token(N).sh I need to cut the tokens using delimiter '_', and need to take string except the last two tokens. In above examlpe output…
user613114
  • 2,731
  • 11
  • 47
  • 73
25
votes
2 answers

Best way to split strings into an array

I'm developing a travel app, I have to read a txt file that contains all the states and countries, as you can notice this is a pretty huge file to read, anyway, this is an example of the text inside the file: Zakinthos (ZTH),GREECE Zanesville…
Rafael Jimeno
  • 626
  • 2
  • 8
  • 20
25
votes
4 answers

Codeigniter CSRF - how does it work

Recently I found out about CSRF attacks and was happy to find out that CSRF protection was added to Codeigniter v 2.0.0. I enabled the feature and saw that a hidden input with a token is added in forms and I assume that it stores the token in a…
CyberJunkie
  • 21,596
  • 59
  • 148
  • 215
25
votes
1 answer

WCF Authentication with custom ClientCredentials: What is the clientCredentialType to use?

I had to ditch the basic WCF UserName/Pwd security and implement my own custom client credentials to hold some more info beyond what is provided by default. I worked throughthis MSDN article, but I'm missing something because it doesn't work. First,…
CodingWithSpike
  • 42,906
  • 18
  • 101
  • 138