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
2
votes
1 answer

Tokenizing a string in Ruby?

I need to tokenize a string based on a few rules in Ruby. Basically, I need to group the file into sections that fit either a variable name, keyword, integer, or operation. So, for example, the file: x:=5;if x > 5 then x:=3; else x:=6; end would…
Tetramputechture
  • 2,911
  • 2
  • 33
  • 48
2
votes
1 answer

Tokenize string using sregex_token_iterator in case with heading space

I usually use sregex_token_iterator in case split text vector split(const string& input, const string& reText) { regex re(reText); sregex_token_iterator first{input.begin(), input.end(), re, -1}, last; return {first,…
newpolaris
  • 147
  • 1
  • 9
2
votes
1 answer

Alternate approaches to token based authentication

I have a RESTful API which will be users will reach via a set of web/mobile clients, and I am trying to figure out how to handle token auth. My understanding is that traditional token auth works as follows: User auths by providing user/pass,…
arcologies
  • 742
  • 1
  • 6
  • 22
2
votes
2 answers

which TokenValidationParameters are needed with UseJwtBearerAuthentication

I am tying to do JwtBearerAuthentication on my .net WebAPI and it is just not working. The Authorize attribute is always claiming isAuthorized = false. I am working with Okta as the SSO. I am authenticating on my client side and getting both an…
twaldron
  • 2,722
  • 7
  • 40
  • 55
2
votes
2 answers

Parse Tokens with Regex in PHP

I am looking to parse a token file that looks something like the one below to grab the token name/value pair. The token/value/nesting relationships are already defined, so i cant change the way the token files are made. It would seem that a context…
Caleb Larsen
  • 739
  • 2
  • 8
  • 17
2
votes
1 answer

Primitive operations provided by a programming language?

I am doing MIT6.00.1x course from edX and in it, Professor Grimson talks about primitives of a programming language. What does it actually mean and secondly, how it is different from the tokens of a programming language? Please answer with reference…
ddlj
  • 131
  • 9
2
votes
2 answers

Google OAuth 2 implicit flow on iOS, refresh token manually

Hi I have the Google OAuth 2 explicit flow working according to: https://developers.google.com/identity/protocols/OAuth2WebServer I also have the implicit flow working on iOS with GIDSignIn, specifically I get the GIDSignInDelegate::sign(_ signIn:…
Zack Morris
  • 4,727
  • 2
  • 55
  • 83
2
votes
0 answers

How to make Guardian detect token in a second app, system2system?

I cannot get an app to find the generated token of another app. Both apps (App1 and App2) live in an umbrella, and share the same config and secret-key. I have my user authentication set up in sessions, the Guardian token is found through: plug…
Martin
  • 47
  • 4
2
votes
1 answer

Validate IP from request against claim in JWT authentication token

I'm developing a .Net Core Web API using JWT authentication (like here). I added a new Claim to store the ip adrress of the request, and then, I want to check it on each consecutive request to validate that the ip address source of the request is…
Johna
  • 2,623
  • 3
  • 21
  • 36
2
votes
1 answer

Node express handle auth token from external api

I'm making my first node + express app and I'm using a npm module that makes calls to an external api. I've a login page with a form where the user enters the credentials, which are then passed via post (ajax client-side, app.post server-side) and…
nip
  • 1,609
  • 10
  • 20
2
votes
3 answers

How exactly a DEDENT token is generated in python?

I am reading a documentation about lexical analysis of python,which described the course how INDENT and DEDENT tokens are generated.I post the description here. The indentation levels of consecutive lines are used to generate INDENT and DEDENT…
wow yoo
  • 855
  • 8
  • 26
2
votes
0 answers

How to get Facebook User Test Access Token C#

I want to make a unit test that call a function which needs User Access Token. Since the facebook User Test Access Token is only valid for 24 hours I always need to recopy User Access Token in my facebook developer page.
Frédéric Fect
  • 213
  • 3
  • 10
2
votes
2 answers

Azure API Apps Access Token (ADAL) not working

I've created an API (Azure API App) and have enabled authentication/authtorization using Azure Active Directory (from the APP API . The app service is registered in AAD and everything looks good so far. I've followed the steps in the the post below…
Mike
  • 145
  • 2
  • 10
2
votes
2 answers

PHP Login/Authentication/Sessions/API/Token

I need to develop a very secure login system. I have an API layer, and my plan is to create a token table. I'll send the username/password (Post) to my API and I generate a unique token (One time token with limited time), I return the token in…
Na30m
  • 259
  • 2
  • 5
  • 11
2
votes
2 answers

What is the regular expression for the set of strings that validate exactly the same for xsd:token and xsd:string?

I want write an XSD to restrict the content of valid XML elements of type xsd:token such that at validation they would indistinguishable from the same content wrapped in xsd:string. I.e. they do not contain the carriage return (#xD), line feed (#xA)…
Michael
  • 285
  • 5
  • 14