You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a Blazor Server application, you can only register one resource. When obtaining the AccessToken for the resource, you can only retrieve one by passing the constant parameter "access_token.resource".
// config resource and scopesbuilder.Services.AddLogtoAuthentication(options =>{options.Endpoint=builder.Configuration["Logto:Endpoint"]!;options.AppId=builder.Configuration["Logto:AppId"]!;options.AppSecret=builder.Configuration["Logto:AppSecret"];options.Resource=builder.Configuration["Logto:KhasApiResource"];options.Scopes=builder.Configuration.GetSection("Logto:KhasApiScopes").Get<string[]>()??Array.Empty<string>();});// get resource accessTokenaccessToken=awaithttpContext.GetTokenAsync(LogtoParameters.Tokens.AccessTokenForResource);
However, in other application SDKs, such as Nuxt, you can configure multiple resources and obtain the AccessToken for a specified resource by passing the resource parameter.
// config resource and scopesexportdefaultdefineNuxtConfig({logto: {scopes: ['shopping:read','shopping:write','store:read','store:write'],resources: ['https://shopping.your-app.com/api','https://store.your-app.com/api'],// ...other configs},});// get resource accessTokenaccessToken.value=awaitclient.getAccessToken('https://shopping.your-app.com/api');
How to configure multiple API resources and obtain Access tokens In a Logto BlazorServer application ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
In a Blazor Server application, you can only register one resource. When obtaining the AccessToken for the resource, you can only retrieve one by passing the constant parameter "access_token.resource".
However, in other application SDKs, such as Nuxt, you can configure multiple resources and obtain the AccessToken for a specified resource by passing the resource parameter.
How to configure multiple API resources and obtain Access tokens In a Logto BlazorServer application ?
Beta Was this translation helpful? Give feedback.
All reactions