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
21
votes
7 answers

Is There A Fast GetToken Routine For Delphi?

In my program, I process millions of strings that have a special character, e.g. "|" to separate tokens within each string. I have a function to return the n'th token, and this is it: function GetTok(const Line: string; const Delim: string; const…
lkessler
  • 19,819
  • 36
  • 132
  • 203
21
votes
1 answer

REST Web Service authentication token implementation

I'm implementing a REST web service using C# which will be hosted on Azure as a cloud service. Since it is a REST service, it is stateless and therefore no cookies or session states. The web service can only be accessed over HTTPS (Certificate…
There is no spoon
  • 1,775
  • 2
  • 22
  • 53
20
votes
3 answers

Is it possible to get an Id token with Chrome App Indentity Api?

I can't get a user's id_token (https://developers.google.com/accounts/docs/CrossClientAuth) from the Chrome identity api (https://developer.chrome.com/apps/identity). I can get an access_token using the chrome identity sample when the oauth section…
19
votes
6 answers

How to transfer custom SPL token by '@solana/web3.js' and '@solana/sol-wallet-adapter'

I am trying to transfer a custom SPL token with the solana-wallet adapter. However I am having trouble getting the wallet's secret key/signing the transaction. I've looked at these answers for writing the transfer code, but I need to get the Signer…
Rick Lancee
  • 1,629
  • 1
  • 15
  • 20
19
votes
1 answer

Is it necessary to refresh tokens every request?

I'm here because I wasn't satisfied with what I found on google. I am generally building SPA's, so for me the process was simple: At succesful login generate a jwt and use it for every request I make from the client. Someone told me that I should…
John
  • 1,081
  • 1
  • 9
  • 34
19
votes
2 answers

How to validate an authentication token against firebase?

I don't mean custom authentication with firebase. What I need is slightly different from that custom authentication that generates tokens in application server and allows access in firebase. Actually, I'm trying to authenticate in firebase with…
blackjack
  • 1,081
  • 2
  • 13
  • 30
18
votes
2 answers

How to access environment secrets from a Github workflow?

I am trying to publish a Python package to PyPI, from a Github workflow, but the authentication fails for "Test PyPI". I successfully published to Test PyPI from the command line, so my API token must be correct. I also checked for leading and…
fchauvel
  • 763
  • 1
  • 6
  • 14
18
votes
3 answers

Is it possible to revoke AWS Cognito IdToken?

Is it possible to revoke AWS Cognito IdToken got after user authentication with it's username and password? In my usecase the access to API Gateway endpoints is restricted by Cognito User Pool Authorizer which takes IdToken as an argument in…
18
votes
6 answers

JWT signature does not match locally computed signature

I am using JwtBuilder builder = Jwts.builder() .setId(user.getEmail()) .signWith(signatureAlgorithm, signingKey); to create a token then Jwts.parser().setSigningKey(secret).parse(token); to authenticate. …
stanlick
  • 1,442
  • 3
  • 16
  • 29
18
votes
4 answers

Unexpected token: u JSON.parse() issue

I have read online that the unexpected token u issue can come from using JSON.parse(). On my iPhone 5 there is no problem, but on my Nexus 7 I get this sequence of errors: View large I realize this is a duplicate, but I am not sure how to solve…
benjipelletier
  • 653
  • 5
  • 11
  • 29
18
votes
1 answer

How to pass X-Auth-Token in the HTTP header in JavaScript

I have a website which uses Token-based authentication. At first, username and password are sent to log the user in and receive the token. For subsequent calls, I need to include the token as X-Auth-Token in HTTP header. I would like to know how to…
GibboK
  • 71,848
  • 143
  • 435
  • 658
18
votes
2 answers

Writing a tokenizer in Python

I want to design a custom tokenizer module in Python that lets users specify what tokenizer(s) to use for the input. For instance, consider the following input: Q: What is a good way to achieve this? A: I am not so sure. I think I will use…
Legend
  • 113,822
  • 119
  • 272
  • 400
18
votes
3 answers

Why is my twitter oauth access token invalid / expired

I am using Twitter to log users into to a website, which seems to be working up until I attempt to obtain a valid Access Token. require("twitteroauth.php"); require 'twconfig.php'; session_start(); $twitteroauth = new…
Finglish
  • 9,692
  • 14
  • 70
  • 114
17
votes
4 answers

Why caching access token is consider bad in oauth2?

I am following this article for revoking user access : http://bitoftech.net/2014/07/16/enable-oauth-refresh-tokens-angularjs-app-using-asp-net-web-api-2-owin/ Now consider after validating user I have issued an accesstoken with 30 minutes life span…
I Love Stackoverflow
  • 6,738
  • 20
  • 97
  • 216
17
votes
2 answers

Nested strtok function problem in C

I have a string like this: a;b;c;d;e f;g;h;i;j 1;2;3;4;5 and i want to parse it element by element. I used nested strtok function but it just splits first line and makes null the token pointer. How can i overcome this? Here is the code: token =…
mausmust
  • 173
  • 1
  • 1
  • 4