147 questions
1 vote
2 answers
137 views
Django Rest Framework TokenAuthentication not working "Invalid Token"
I'm successfully creating a token upon a user's login (using a CustomUser model that replaces the username field with email), but when using this token in subsequent requests, the response is "...
1 vote
1 answer
2k views
How can I add a custom attribute to the Entra ID access token?
I'm trying to add custom attributes to my authentication token but I'm running into an issue with adding custom attribute. I've tried the methods suggested in: Issue to add custom claim "...
1 vote
0 answers
101 views
Getting exception: server returned response code 401 ; while implementing token based authentication for jax-rs with grizzly in java
I am trying to implement token based authentication for a simple hello world program in JAX-RS with Grizzly. I have set up a server and client class and a hello resource for displaying the hello world ...
0 votes
1 answer
921 views
Upload xlsx to confluence page as attachment via REST API and token authentication
I am writing a Powershell script which will upload an Excel document to Atlassian Confluence page via REST API, using token authentication. Write-Host "Start of script" $userToken = "...
0 votes
1 answer
549 views
Why would Django Rest Framework token authentication work in Postman but not in browser
I have a Django REST framework API that uses TokenAuthentication. In Postman, I can authenticate with the API using a token and make requests successfully. However, when I try to use the browsable API ...
1 vote
2 answers
480 views
Token Authentication using OpenIddict does not work with Local IIS Server but works with IIS Express in ASP.NET Core 6.0
I am using OpenIddict in .Net Core 6.0 for token-based authentication and authorization for my REST/Web API It works within Visual Studio IIS Express but not on my Local IIS server. When I call the ...
2 votes
2 answers
929 views
Symfony 6.2 does not reach token handler on token authentication
Symfony 6.2 does not reach custom token handler while executing a request if token_extractors equals to header in the security.yml. Here is the security.yml security: password_hashers: ...
2 votes
1 answer
1k views
Django: Create manualy session cookie and authenticate later with it
I am using Django-Rest-Framework with token authentication. In my Android App I want to open a webview and display some content from a view which needs authentication. Because of this I wrote a rest ...
0 votes
1 answer
149 views
Django Token authentication problem accessing another account
I have made Account model, which is now custom user model in Django my app. Also, I have Token authentication, but I do not know how to refresh Token, and how frequently I have to change Token for ...
0 votes
1 answer
789 views
"Unable to log in with provided credential" in Django REST Framework
So, I'm learning DjangoRF through a Udemy course in which we build an API with a token authentication. All code written, I launch my server, I try to login via example client and this error occur: ...
1 vote
1 answer
476 views
How to create a new token with custom created datetime in Django Rest Framework?
I am using Token Authentication in my Django Rest Framework project. I have noticed that while creating a token, if I specify the created datetime field in the create method, than the token is not ...
3 votes
0 answers
498 views
Is REST framework token authentication safe?
I am relatively new to REST Framework for django. I was creating a simple app to login the users and I tried using Token Authentication. My concern is the tokens are created for each users and they ...
1 vote
1 answer
2k views
Django REST framework TokenAuthentication returns anonymous user
How do I properly implement DRF TokenAuthentication without the request object returning an anonymous user when I try to log in? according to the docs, when authenticated, the TokenAuthentication ...
1 vote
1 answer
2k views
"Authentication credentials were not provided." Thunder client Django Rest
I am trying to restrict dashboard access only, which can be viewed only when the token is passed into the header but... if request.method == "POST": user_name = request.POST['...
0 votes
1 answer
333 views
How authorize a web API using a cookie based authentication
I had a MCV core app that uses cookie based authentication (stores user credentials in DB). Later I introduced a web api as the backend of this MVC application. Now both are hosted together as a Azure ...