/access-token missing from v6

We use method GetAccessToken which is unavailable in v6.
Any help on how to enable it?

Kind regards

What GetAccessToken method? The GetAccessToken Service?

That still exists in v6:

Strange.
It is not listed in /metadata and dto is not generated in any of /types so we cannot consume it.

https://blazor-wasm-api.jamstacks.net/metadata

https://blazor-wasm-api.jamstacks.net/types/csharp
https://blazor-wasm-api.jamstacks.net/types/dart

It’s not generated because it’s already built into the Service Client libraries, e.g.

in ServiceStack.Client in C#:

Or in servicestack dart library:

I’m trying to use it trough dart gRPC and it was generated in services.proto file in version 5.
Since upgrade we cannot access this service.

For C# gRPC you can avoid code-gen and use existing GetAccessToken DTO with the GrpcServiceClient code-first generic Service Client.

Which wont be possible when using a grpc code generated proxy, i.e. in a different language like Dart.

But this looks like a use-case for the new ForceInclude Metadata Types v6 feature:

public override void Configure(Container container)
{
    Metadata.ForceInclude = new() {
        typeof(GetAccessToken),
    };
}
1 Like

Ok, with this change service is listed in /metadata but it’s still missing in any of /types including services.proto
I understand that for REST I can use built-in DTO’s inside client, but for gRPC it needs to be in services.proto

I am using gRPC in Flutter application.

Then only solutions I can think of with the latest version is to use a HTTP Call to fetch the token from /access-token or keep a locally modified services.proto that includes the additional gRPC API.

Thank you, I will most likely go with HTTP to /access-token

FYI, when I try to access GetAccessToken to v6 server with v5 generated proto files, server shows “unimplemented”:

info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 POST http://10.10.10.50:20002/GrpcServices/PostGetAccessToken application/grpc -
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[0]
      Executing endpoint 'gRPC - Unimplemented method for GrpcServices'
info: Microsoft.AspNetCore.Routing.EndpointMiddleware[1]
      Executed endpoint 'gRPC - Unimplemented method for GrpcServices'
info: Microsoft.AspNetCore.Hosting.Diagnostics[2]
      Request finished HTTP/2 POST http://10.10.10.50:20002/GrpcServices/PostGetAccessToken application/grpc - - 200 0 application/grpc 181.0527ms

Which would leave a HTTP call as the only option.

If you can log the issue in either https://servicestack.net/ask or https://github.com/ServiceStack/Issues we can remember to look into it.

Hello

Since GetAccessToken is built into ServiceStack client libraries, I’m having issues with release version on android.
Can you provide proguard rules for ServiceStack client?

I have tried with this -keep class net.servicestack.client.** { *; } and it works, but I’m not sure if there is a better way or it’s ok to leave it like this?

Please submit any feature requests to https://servicestack.net/ideas so they don’t get lost, feedback can be added & their demand measured.

The client libraries contains the types & functionality required for calling typed ServiceStack APIs, which would be different for every App so I’m assuming you’d either manually specify the types you use or include them all to avoid the manual book keeping.