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
41
votes
9 answers

Cannot clone git from Azure DevOps using PAT

I cannot clone a simple repository from Azure DevOps. OS: Ubuntu 18.10 I do this: Got to Azure DevOps Click on the top right corner on my user name Go to the security tab Create a PAT with all the scope (to be sure there is no scope problem) Copy…
Jose
  • 1,389
  • 3
  • 16
  • 25
40
votes
7 answers

How to create a authentication token using Java

On my Java EE6, REST service, I want to use authentication tokens for login from mobile devices, User will send their username, password and server will send back a token, which will be used to authorize the user on their further requests for a…
Spring
  • 11,333
  • 29
  • 116
  • 185
39
votes
1 answer

Token Authenticatable module in Devise

I'm starting using Devise in my Rails app, but the Token Authenticatable: signs in a user based on an authentication token (also known as "single access token") module puzzles me. Is the user authenticated only for his current session? If he uses…
Marius Butuc
  • 17,781
  • 22
  • 77
  • 111
39
votes
3 answers

Using Devise tokens to log in, is this built in?

So, I'm trying to use tokens with Devise (version 1.0.3 with Rails 2.3.8) to let a user log in, but I'm not entirely sure where to begin. http://zyphdesignco.com/blog/simple-auth-token-example-with-devise The above tutorial helped me turn on the…
J.R.
  • 5,789
  • 11
  • 55
  • 78
38
votes
6 answers

Create a random token in Javascript based on user details

I want to create a random string (token) which can be used to identify a user whilst avoiding any potential conflicts with any other users' tokens. What I was thinking of was an MD5 hash of navigator.userAgent + new Date().getTime() to generate the…
fire
  • 21,383
  • 17
  • 79
  • 114
36
votes
11 answers

Twitter API - Reasons for "invalid or expired token"

What are the possible reasons that can cause token to become expired (besides having the user un-authorising the app)? My problem is that I have an app with several thousands of users, all API communication works perfectly but for some users I am…
Ran
  • 3,455
  • 12
  • 47
  • 60
35
votes
1 answer

Batch file FOR /f tokens

Can anyone please explain exactly how the following code works, line by line. I'm really lost. I've been trying to learn how to use the FOR command but I don't understand this. @echo off for /f "tokens=* delims= " %%f in (myfile) do ( set…
user880248
34
votes
4 answers

Getting substring of a token in for loop?

I have this for loop to get a list of directory names: for /d %%g in (%windir%\Assembly\gac_msil\*policy*A.D*) do ( echo…
Ray Cheng
  • 12,230
  • 14
  • 74
  • 137
33
votes
2 answers

Should I use JWT or Basic Token authentication in Django Rest Framework?

I'm about to implement Token Authentication in my API using Django Rest Framework. But I'm not sure if I should use the basic token build-in DRF or use the JSON Web Token (JWT) standard (using this package djangorestframework-jwt) The only reference…
EdgarT
  • 1,080
  • 11
  • 18
33
votes
6 answers

Iphone device token - NSData or NSString

I am receiving iPhone device token in the form of NSData object. When I tested my notifications script function, I have only copied that object from log and the notifications went fine. However when I try now to automatically do it, I am sending…
Mladen
  • 25,578
  • 11
  • 39
  • 48
32
votes
1 answer

Firebase Cloud Messaging - Managing Registration Tokens

I'm looking at implementing messaging between mobile and browser apps using Firebase cloud messaging and i have a few questions, that the docs don't seem to answer. For being able to receive messages, you need a Registration Token (RT). Messages…
32
votes
3 answers

Generate a single use token in PHP: random_bytes or openssl_random_pseudo_bytes?

I need to generate a single-use token in PHP. There are two functions available that I can use for this that seem to do the same thing: random_bytes and openssl_random_pseudo_bytes. For example, using…
Dave Hollingworth
  • 3,670
  • 6
  • 29
  • 43
32
votes
2 answers

Tokenizer vs token filters

I'm trying to implement autocomplete using Elasticsearch thinking that I understand how to do it... I'm trying to build multi-word (phrase) suggestions by using ES's edge_n_grams while indexing crawled data. What is the difference between a…
user3125823
  • 1,846
  • 2
  • 18
  • 46
32
votes
2 answers

When will InstanceIDListenerService be called and how to test it?

With the last changes to Android GCM now a InstanceIDListenerService is provided to be able to listen to token refreshes by overriding the onTokenRefresh method. But when will this method be called? And is there any way to test it manually?
Eylen
  • 2,617
  • 4
  • 27
  • 42
32
votes
1 answer

Implementing OAuth provider in Java

What is the fastest/easiest way to get an OAuth provider running in Java? Specifically, I need to authorize third-party apps to access certain web services (I'm thinking token authentication using OAuth). I've been looking at Jersey's OAuth…
jay_soo
  • 1,278
  • 2
  • 13
  • 20