Unable to set scope games::prime for Login with Amazon

83 Views Asked by At

I've been tryin to setup an external login with amazon to integrate prime gaming for my web app in asp net core 3.1. I've been following this Amazon Prime Gaming Integration. I have been successfully stored the amazon userId, its token, refresh token and expires in into my database. However, I'm unable to call a post API request to /api/account/link to sync up my account according to this document. I am getting an error with message: Not all permissions are authorized. I did a bit research and it mentioned in another document link (Tips-Troubleshoot) that I need to set both scopes to games::prime and profile (I only had profile set before).

However, when adding games::prime scope, I get an exception for invalid scope: invalid_scope;Description=An unknown scope was requested

I'm using AspNet.Security.OAuth.Amazon to help with the external login with amazon, and this is the code that I have in my Startup.cs file

services.AddAuthentication()                     
                .AddAmazon(o =>
                {
                    o.ClientId = clientId;
                    o.ClientSecret = clientSecret;
                    o.Scope.Add("profile");
                    o.Scope.Add("games::prime");
                    o.SaveTokens = true; // get access token and refresh token
                    o.AccessDeniedPath = new PathString("/Home/WebAppSetting");
                })

If I remove games::prime from the scope, then everything works but then I will get an error message Not all permissions are authorized

Can anyone please tell me what I'm missing and not doing correct in here ? I have been searching for amazon documents on their sites, but seems like there is nothing useful there.

Thank you

1

There are 1 best solutions below

0
Hoang Minh On

It turned out that in order to use scope games::prime, you need to contact amazon team to have them unblock that for you. This is not mentioned at all in the push integration documentation.