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
50
votes
3 answers

Authenticating requests from mobile (iPhone) app to ASP.Net Web API (Feedback requested on my design)

I'm designing a web site that will have a mobile companion (initally iPhone only). The web site will be an ASP.Net MVC 3 application. I'll also have an ASP.Net Web API site (MVC 4) to expose services to the iPhone application. The iPhone app will…
Stoop
  • 1,235
  • 3
  • 17
  • 23
49
votes
4 answers

Firebase InstanceID.instanceID().token() method is deprecated

I am working with swift and firebase. Previously I was using following method to get firebase token which then I was using to store into database to send notifications. InstanceID.instanceID().token() Now this method is showing as deprecated since…
Deepak
  • 1,030
  • 2
  • 10
  • 21
49
votes
4 answers

Firebase 3.x - Token / Session Expiration

Does anyone know how long would it take for the token to expire? There no option now to set the token validity on the console.
shibapoo
  • 1,909
  • 3
  • 16
  • 22
49
votes
11 answers

Error: Uncaught SyntaxError: Unexpected token <

For some reason, I'm getting this error message: Uncaught SyntaxError: Unexpected token < For this line of code: title: '', In this…
Qcom
  • 18,263
  • 29
  • 87
  • 113
49
votes
4 answers

How to not-analyze in ElasticSearch?

I've got a field in an ElasticSearch field which I do not want to have analyzed, i. e. it should be stored and compared verbatim. The values will contain letters, numbers, whitespace, dashes, slashes and maybe other characters. If I do not give an…
Alfe
  • 56,346
  • 20
  • 107
  • 159
49
votes
2 answers

WARNING: Can't verify CSRF token authenticity in case of API development

I am right now developing web APIs with Ruby on Rails. When the Rails app receives POST request without any csrf token, the following error message shall happen. Because the app has no views. WARNING: Can't verify CSRF token authenticity So my…
diveintohacking
  • 4,783
  • 6
  • 29
  • 43
48
votes
1 answer

Access token and Refresh token best practices ? How to implement Access & Refresh Tokens

I'm making SPA, and decided to use JWT for Authentication/Authorization, and I have read some blogs about Tokens vs Cookies. I understand how cookie authorization works, and understand how basic token authorization works. The problem is, I don't see…
Emilis Vadopalas
  • 1,019
  • 2
  • 14
  • 22
46
votes
2 answers

Why is OAuth designed to have request token and access token?

In the OAuth protocol, a service consumer will ask a user to authorize a request token in the service provider domain, then exchanges the request token for a access token from the service provider. I'm wondering why OAuth is designed to have two…
Morgan Cheng
  • 73,950
  • 66
  • 171
  • 230
46
votes
3 answers

django rest framework - token authentication logout

I have implemented the Token Authentication according to the django rest framework Docs. Form what I read, the Token Authentication of DRF is quite simple - one token per user, the token doesn't expire and is valid for use always (am I right?). I…
46
votes
3 answers

Nodemailer/Gmail - What exactly is a refresh token and how do I get one?

I'm trying to do a simple contact form in a node app, using nodemailer. I want all the msg to be sent from a gmail account I made for this purpose, to my personnal mail. on the client side, all I do is to get the name/mail/message of the customer…
Radioreve
  • 3,173
  • 3
  • 19
  • 32
45
votes
1 answer

Sessions vs. Token based authentication

I want to know which is more safe to implement for authentication and why? Session based authentication OR Token based authentication? I know sessions can be used for other things as well, but right now I am only interested about authentication. Is…
which_part
  • 792
  • 3
  • 11
  • 26
43
votes
7 answers

Unable to get access token from Facebook. Got an OAuthException says "Error validating verification code"

I am using java and the purpose of my demo application is simple: Update user status. I followed the Server-side Flow on page http://developers.facebook.com/docs/authentication. I got the auth dialog, facebook lead to the callback url and I got the…
DeepNightTwo
  • 4,809
  • 8
  • 46
  • 60
43
votes
3 answers

Android: Is it a good idea to store Authentication Token in Shared Preferences?

I have an application that communicates with a server. When the user logins to the application an Authentication Token is crated on the server and stored in the SharedPreferences of the application and whenever the application requests data from a…
Eric Bergman
  • 1,453
  • 11
  • 46
  • 84
42
votes
7 answers

Split a string into words by multiple delimiters

I have some text (meaningful text or arithmetical expression) and I want to split it into words. If I had a single delimiter, I'd use: std::stringstream stringStream(inputString); std::string word; while(std::getline(stringStream, word,…
Sergei G
  • 1,550
  • 3
  • 24
  • 44
42
votes
1 answer

How safe is JWT?

I am learning about JWT for the security of my project, but I have a question. If I recieve the token correctly after I did the login, but someone else (hacker) in other place steals this specific token, can he access to my session? The server that…
in3pi2
  • 877
  • 1
  • 11
  • 22