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
No related merge requests found
......@@ -61,8 +61,10 @@ 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/')
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.
Please register or to comment