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Добавлен плагин аутентификации
......@@ -61,10 +61,12 @@ oauth2_plugin = OAuth2Plugin(
client_id='client_id', client_secret='client_secret',
token_url='https://example.com/oauth/token', audience='audience'
)
call_credentials = grpc.metadata_call_credentials(oauth2_plugin)
channel = grpc.aio.insecure_channel('https://example.com/api/')
request = GetRequest(user_id=1)
stub = UsersStub(channel)
stub.Get(request, credentials=call_credentials)
with grpc.insecure_channel('localhost:50051') as channel:
request = GetRequest(user_id=1)
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