Bearer has no security token

Hello I am trying to do something simple after following your main tutorial but as I run this code:
https://pastebin.com/xKMdxCUq

on page load to set up a variable I have a return of:

https://pastebin.com/kdF9krbb

Not sure I understand what the problem is. There are no errors in the second link with the output.

The error is here:
https://pastebin.com/SWPyRh9z The bearer has no security token

This means that the Authorization HTTP header is probably missing. You can check that from your browser's developer tools in the network tab. The HTTP request to ServerMethods controller should contain an Authorization HTTP header.

When I run the app with the Admin/Admin credentials, it works, is there a specific reason it works like that? Also why does similar code with the Authorization decorator work but not this specific one?

Not sure why this wouldn't work. Honestly I would expect it not to work with the admin/admin credentials because they do not represent a real user. Your code that gets the user from the UserManager class should not work with admin/admin.

Anyway I tested with the attached application and couldn't find any problems with both the admin account and a regular one - the Authorization token was sent as expected. The application uses the Northwind database but would work with any other.northwind.zip (195.8 KB)

I am starting with Radzen as my work requires me to, so I am trying to get the hang of it. So I will ask it here, if I wanted to show the CNPJN variable of a user, how would I declare it in a label? Like the user email seems to be ${security.user.name}, how should I grab that variable? I tried following the tutorial but I hit this authetication issue.

Is CNPJN a custom column? Exposing a custom user property is described here.

Your code looks correct and a similar approach works in the attached sample application. Did you check if the Authorization header is being sent? Have you tried debugging the code to see if it is hit?

If you have a Radzen Professional subscription you can send us your application to info@radzen.com and we will see if there are any problems.