Hi anonymous user,
If you are missing some permissions in your shared access signature, you may not get all of the data. Make sure the following are added:
Allowed services: Blobs
Allowed resource types: Container, Object
Allowed permissions: Read, Write, List, Create
There was also a bug reported related to the docker containers wiping away user data. With this bug, the middleware container handling the authentication on Linux App Services restarts and loses its tokens, and one workaround is to use a blob storage token which means that the Azure Middleware Container will store the tokens in a blob storage instead of on disk and thereby prevent them from restarting. The information is only wiped away on Linux and on Windows the restart will work as expected. If you need to reuse the information of current user through /.auth/me, you need to record the authMe information through code after the first log in. See: Restarting Azure App Service resets /.auth/me
Are you specifying the userDetails property? The documentation also has several examples of how to get the data using "await fetch('/.auth/me')" and grabbing either the client principal object that stores the userDetails, or getting the userDetails separately.
async function getUserInfo() {
const response = await fetch('/.auth/me');
const payload = await response.json();
const { clientPrincipal } = payload;
return clientPrincipal;
}
console.log(getUserInfo());
This blog post also has a good example of this:
async function getUsername() {
// call the endpoint
const response = await fetch('/.auth/me');
// convert to JSON
const json = await response.json();
// ensure clientPrincipal and userDetails exist
if(json.clientPrincipal && json.clientPrincipal.userDetails) {
// return userDetails (the username)
return json.clientPrincipal.userDetails;
} else {
// return null if anonymous
return null;
}
}
Let me know if any of this helps.