gRRC c# oAuth2/OpenID Connect

270 views
Skip to first unread message

Andrius Norkaitis

unread,
Sep 12, 2016, 1:00:27 PM9/12/16
to grp...@googlegroups.com
Hello.

Is there any guidance on how to add support to our own OAuth authentication? We plan to use https://github.com/IdentityServer/IdentityServer4 with Hybrid Flow and we are evaluating if is feasible to make the native clients (Android/iPhone) communication with our servers (.Net C#) by using grps but we are concerned about the authentication.

Best regards,
Andrius

Carl Mastrangelo

unread,
Sep 13, 2016, 7:00:46 PM9/13/16
to grpc.io, and...@gmail.com
I can't speak for Objective C, but on Android I think you can use https://github.com/grpc/grpc-java/blob/master/auth/src/main/java/io/grpc/auth/GoogleAuthLibraryCallCredentials.java  If that doesn't help, the other files in that directory may give you a hint as to how to move forward.

Jan Tattermusch

unread,
Sep 19, 2016, 4:07:20 AM9/19/16
to Andrius Norkaitis, grpc.io
For the server side:

Unfortunately, C# servers don't expose authentication API yet (only C++ does). In order to authenticate the calls on the server side, you need to inspect contents of request headers (and look for the right metadata elements that contains the auth token) in your handlers and then call the code that validates the tokens (probably part of IdentityServer).
Once the server side authentication API is in place, you should be able to register a callback that validates the auth tokens for all incoming calls, so that you don't need to invoke the validation code in each handler yourself.

Here's the issue to track:

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/CAB4ybe9qG4f4o_eVqXNJvYWYkC1ubLUVMnuS0UJM1DDFi6B3hA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages