Hi all,
I’ve been trying to configure server to server access in a new local instance of umbraco, and I’m getting a 401 error when fetching the data. I followed the documentation, but I’ll explain exactly what I did in case I’m missing something:
- Create a new Umbraco project with the
dotnet new umbraco -n MyProject -da command
- Set up the project with SQLite
- Create a new member
- Add the proper data to appsettings “DeliveryApi”:
{
"Enabled":true,
"MemberAuthorization":{
"ClientCredentialsFlow":{
"Enabled":true,
"AssociatedMembers":[
{
"ClientId":"client-id",
"ClientSecret":"client-secret",
"UserName":"apimember"
}
]
}
}
}
- Restart the service
- Check that the Member is now API Member
- Implement the example code in the previously mentioned documentation. As a note, took care that the clientid is correctly set when requesting the token
($"umbraco-member-{clientId}")
- Execute the
consumer.ExecuteAsync();
method as stated in the documentation.
At this point the token is correct, I checked with both debugging the app and with Bruno, but once the delivery api endpoint is called I’m getting the 401 error.
Am I missing something? Or maybe there’s something else I need to do?
Thanks a lot for your time!