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

JWT + cookies + HTTPS + CSRF

I already worked with JWT on mobile app but I will implement it on a website for the first time for the authentication and I have a little thing I still didn't understood : if I use JWT token with localStorage, XSS attacks are possible if I use JWT…
Alex
  • 537
  • 5
  • 17
17
votes
1 answer

Verification email with token in passport.js

I just looking for solution which makes verification email with token for my local autentification in passport.js Is there some plugin or component for node which can make me verification easyer? Or I have to do it myself? My…
Makromat
  • 1,540
  • 5
  • 26
  • 47
17
votes
3 answers

PHP form token usage and handling

I'm a beginner working on a login script in PHP. This is the form token statement that I have so far: $_SESSION["form_token"] = md5(rand(time (), true)) ; The statement is issued just after the user indicates that he/she wants to login. My limited…
dave
  • 1,041
  • 2
  • 12
  • 18
16
votes
3 answers

How to make Apple Sign In Revoke Token POST Request?

How do I structure a swift POST request to satisfy the Sign In With Apple token revocation requirements? I am not sure what form-data, client_id, client_secret, token, or token_type_hint are supposed to be. I was able to implement Sign in With Apple…
Andre
  • 562
  • 2
  • 7
  • 18
16
votes
3 answers

.NET Web API: Set a different Refresh Token Expiration time for different users

I'm using Identity Server 3 to authenticate and generate Access/Refresh tokens for my angular Client. I'm currently setting the Refresh Token to expire in 48 hours for my Angular Client. Some users who use my Angular application will need to be…
Mike D
  • 201
  • 3
  • 11
16
votes
1 answer

Send post request with bearer token and json body in Swift

I'm pretty new to swift and i tried to make a post request to a website, but couldn't come up with an working result, yet. All examples I found didn't work for me either. I need to send a json body to https://mypostrequestdestination.com/api/ The…
Mason
  • 523
  • 1
  • 4
  • 10
16
votes
1 answer

Receiving 401 status with Safari not Chrome in React

The problem we are facing is the following: When using Safari as a browser, rather than Chrome, we receive a 401 status on a get api call. The technologies we are using are React and Django Rest Framework. In React we are also using axios. Again,…
Makai
  • 449
  • 4
  • 8
16
votes
2 answers

Why should strtok() be deprecated?

I hear this from a lot of programmers that the use of strtok maybe deprecated in near future. Some say it is still. Why is it a bad choice? strtok() works great in tokenizing a given string. Does it have to do anything with the time and space…
Pushan Gupta
  • 3,697
  • 5
  • 23
  • 39
16
votes
6 answers

KEYCLOAK - Refresh/update token not working

I have single page application that is built using Angularjs and integrated with Keycloak for authentication and authorization. I am able to login into my application, get loggedin user roles etc. goes The moment refresh token call, it always…
Ankur Singhal
  • 26,012
  • 16
  • 82
  • 116
16
votes
1 answer

Why mobile apps are usually authenticated via token, not cookies

I am currently planning infrastructure for the new project with common backend for web and mobile application. The mobile applications are usually authorised by tokens, not the cookies but I am wondering why? I have few ideas in mind like lack of…
kulak
  • 852
  • 7
  • 16
16
votes
1 answer

WCF how to pass token for authentication?

I have a WCF service which would like to support basicHttpBinding and webHttpBinding. When the client successfully login, server will generate a token for client to pass to server on all the request make later. Question is how the client can pass…
Kevin
  • 185
  • 1
  • 1
  • 5
15
votes
1 answer

Why does GCC remove the whitespace between the preprocessing tokens?

Sample code: #define X(x,y) x y #define STR_(x) #x #define STR(x) STR_(x) STR(X(Y,Y)) Invocations: $ gcc t222.c -std=c11 -pedantic -Wall -Wextra -E -P "Y Y" $ gcc t222.c -std=c11 -pedantic -Wall -Wextra -E -P -D"Y()" "YY" Why does GCC remove…
pmor
  • 5,392
  • 4
  • 17
  • 36
15
votes
2 answers

In compiler construction, is a symbol the same as a token?

In compiler construction, when you talk about tokens, is a token the same like a symbol / just another term for a symbol? After some research I think to understand, that a token is a symbol with a reference to the symbol table, therefore some kind…
stefan.at.kotlin
  • 15,347
  • 38
  • 147
  • 270
15
votes
0 answers

Next.js: Jest encountered an unexpected token. Jest failed to parse a file. Crashing due to dot ( .{color: red} ) before a className in CSS files

Jest encountered an unexpected token Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax. Out of the box Jest supports Babel,…
Arslan
  • 240
  • 3
  • 9
15
votes
1 answer

How to Get User Token for Slack API?

I made a new Slack App, got both my user token and bot token, and now my app can post messages as me. But what if I want this app to post messages as someone else from my team? How to get their token? Or where they can find it?
Alex Rublev
  • 183
  • 1
  • 1
  • 6