7,666 questions
726
votes
35
answers
2.5m
views
Parse (split) a string in C++ using string delimiter (standard C++)
I am parsing a string in C++ using the following:
using namespace std;
string parsed,input="text to be parsed";
stringstream input_stringstream(input);
if (getline(input_stringstream,parsed,' '))
{
...
569
votes
8
answers
448k
views
What is token-based authentication?
I want to understand what token-based authentication means. I searched the internet but couldn't find anything understandable.
345
votes
19
answers
765k
views
Sending the bearer token with axios
In my react app i am using axios to perform the REST api requests.
But it's unable to send the Authorization header with the request.
Here is my code:
tokenPayload() {
let config = {
headers: ...
275
votes
4
answers
250k
views
What's the difference between JWTs and a Bearer Token?
I'm learning something about Authorization like Basic, Digest, OAuth2.0, JWTs, and Bearer Token. JWTs are used as an Access_Token in the OAuth2.0 standard. JWTs appears at RFC 7519, and Bearer Token ...
242
votes
25
answers
145k
views
Password authentication is temporarily disabled as part of a brownout. Please use a personal access token instead [duplicate]
I was using a username password for pushing my code. It was working for several months, but suddenly I'm not able to do it and am getting this error:
Username for 'https://github.com': shreyas-jadhav
...
211
votes
3
answers
64k
views
Do login forms need tokens against CSRF attacks?
From what I've learned so far, the purpose of tokens is to prevent an attacker from forging a form submission.
For example, if a website had a form that input added items to your shopping cart, and ...
183
votes
3
answers
90k
views
How can I concatenate twice with the C preprocessor and expand a macro as in "arg ## _ ## MACRO"?
I am trying to write a program where the names of some functions are dependent on the value of a certain macro variable with a macro like this:
#define VARIABLE 3
#define NAME(fun) fun ## _ ## ...
177
votes
4
answers
202k
views
Authenticating socket io connections using JWT
How can I authenticate a socket.io connection? My application uses a login endpoint from another server (python) to get a token, how can I get use that token whenever a user opens a socket connection ...
176
votes
13
answers
168k
views
Do Google refresh tokens expire?
I have used the refresh token several times in just a short period for testing purposes, but I wonder whether Google refresh tokens ever expire? Can I use the same refresh token to get another access ...
166
votes
9
answers
459k
views
Python requests library how to pass Authorization header with single token
I have a request URI and a token. If I use:
curl -s "<MY_URI>" -H "Authorization: TOK:<MY_TOKEN>"
etc., I get a 200 and view the corresponding JSON data.
So, I installed requests and when ...
159
votes
7
answers
172k
views
Where to store the refresh token on the Client?
My SPA application uses the following architecture (source):
This assumes that my client application knows about the refresh token, because I need it to request a new access token if no user ...
151
votes
6
answers
109k
views
How to securely store access token and secret in Android?
I am going to use oAuth to fetch mails and contacts from google. I don't want to ask the user each time to log in to obtain an access token and secret. From what I understood, I need to store them ...
144
votes
2
answers
194k
views
What's the meaning of the "kid" claim in a JWT token?
I generated a JWT and there are some claims which I understand well, but there is a claim called kid in header. Does anyone know what it means?
I generated the token using auth0.com
138
votes
16
answers
440k
views
How does strtok() split the string into tokens in C?
Please explain to me the working of strtok() function. The manual says it breaks the string into tokens. I am unable to understand from the manual what it actually does.
I added watches on str and *...
132
votes
2
answers
79k
views
Creating C macro with ## and __LINE__ (token concatenation with positioning macro)
I want to create a C macro that creates a function with a name based
on the line number.
I thought I could do something like (the real function would have statements within the braces):
#define UNIQUE ...