Skip to content
Snippets Groups Projects
Commit c009fef0 authored by Georgiy Eterevskiy's avatar Georgiy Eterevskiy
Browse files

Fix auth example

parent 2882f296
No related branches found
No related tags found
1 merge request!3Добавлен плагин аутентификации
This commit is part of merge request !3. Comments created here will be created in the context of that merge request.
...@@ -61,10 +61,12 @@ oauth2_plugin = OAuth2Plugin( ...@@ -61,10 +61,12 @@ oauth2_plugin = OAuth2Plugin(
client_id='client_id', client_secret='client_secret', client_id='client_id', client_secret='client_secret',
token_url='https://example.com/oauth/token', audience='audience' token_url='https://example.com/oauth/token', audience='audience'
) )
call_credentials = grpc.metadata_call_credentials(oauth2_plugin) call_credentials = grpc.metadata_call_credentials(oauth2_plugin)
channel = grpc.aio.insecure_channel('https://example.com/api/')
request = GetRequest(user_id=1) with grpc.insecure_channel('localhost:50051') as channel:
stub = UsersStub(channel) request = GetRequest(user_id=1)
stub.Get(request, credentials=call_credentials) stub = UsersStub(channel)
stub.Get(request, credentials=call_credentials)
``` ```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment