0

Is there a way to implement openiddict to a dotnet core Grpc service, I added the following in Startup.cs :

            services.AddOpenIddict().AddCore(options => {
                options.UseEntityFrameworkCore()
                       .UseDbContext<DBContext>();
            }).AddServer(options => {
                options.AcceptAnonymousClients();
                options.AllowPasswordFlow()
                       .AllowRefreshTokenFlow();
                options.AddDevelopmentSigningCertificate();
            }).AddValidation(options =>{
                options.EnableAuthorizationValidation();
            });

also added in Configure:

          app.UseAuthentication();
          app.UseAuthorization();

How do can I get GetOpenIddictServerRequest in my service and generate a token?

1 Answer 1

1

How do can I get GetOpenIddictServerRequest in my service and generate a token?

Being able to return authorization or token responses from an arbitrary gRPC service is not a supported scenario in OpenIddict (and not even a standard thing).

That said, nothing prevents you from using token authentication to protect your gRPC services. For that, you can use the OpenIddict validation handler or the JWT handler. For more information regarding gRPC and authentication, you can read Authentication and authorization in gRPC for ASP.NET Core.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.