Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
09321ea1
Commit
09321ea1
authored
9 years ago
by
Michael Lumish
Browse files
Options
Downloads
Plain Diff
Merge pull request #251 from mbrukman/auth-support
Fixes for auth support docs
parents
2285e081
05514b04
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
grpc-auth-support.md
+3
-3
3 additions, 3 deletions
grpc-auth-support.md
with
3 additions
and
3 deletions
grpc-auth-support.md
+
3
−
3
View file @
09321ea1
...
@@ -31,7 +31,7 @@ Tokens to each request being made on the channel.
...
@@ -31,7 +31,7 @@ Tokens to each request being made on the channel.
This is the simplest authentication scenario, where a client just wants to
This is the simplest authentication scenario, where a client just wants to
authenticate the server and encrypt all data.
authenticate the server and encrypt all data.
```
```
cpp
SslCredentialsOptions
ssl_opts
;
// Options to override SSL params, empty by default
SslCredentialsOptions
ssl_opts
;
// Options to override SSL params, empty by default
// Create the credentials object by providing service account key in constructor
// Create the credentials object by providing service account key in constructor
std
::
unique_ptr
<
Credentials
>
creds
=
CredentialsFactory
::
SslCredentials
(
ssl_opts
);
std
::
unique_ptr
<
Credentials
>
creds
=
CredentialsFactory
::
SslCredentials
(
ssl_opts
);
...
@@ -52,7 +52,7 @@ passed to the factory method.
...
@@ -52,7 +52,7 @@ passed to the factory method.
gRPC applications can use a simple API to create a credential that works in various deployment scenarios.
gRPC applications can use a simple API to create a credential that works in various deployment scenarios.
```
```
cpp
std
::
unique_ptr
<
Credentials
>
creds
=
CredentialsFactory
::
GoogleDefaultCredentials
();
std
::
unique_ptr
<
Credentials
>
creds
=
CredentialsFactory
::
GoogleDefaultCredentials
();
// Create a channel, stub and make RPC calls (same as in the previous example)
// Create a channel, stub and make RPC calls (same as in the previous example)
std
::
shared_ptr
<
ChannelInterface
>
channel
=
CreateChannel
(
server_name
,
creds
,
channel_args
);
std
::
shared_ptr
<
ChannelInterface
>
channel
=
CreateChannel
(
server_name
,
creds
,
channel_args
);
...
@@ -121,7 +121,7 @@ stub = Helloworld::Greeter::Stub.new('localhost:50051')
...
@@ -121,7 +121,7 @@ stub = Helloworld::Greeter::Stub.new('localhost:50051')
...
...
# Authenticating with Google
# Authenticating with Google
require
'googleauth'
# from
[googleauth](
http://www.rubydoc.info/gems/googleauth/0.1.0
)
require
'googleauth'
# from http://www.rubydoc.info/gems/googleauth/0.1.0
...
...
creds
=
GRPC
::
Core
::
Credentials
.
new
(
load_certs
)
# load_certs typically loads a CA roots file
creds
=
GRPC
::
Core
::
Credentials
.
new
(
load_certs
)
# load_certs typically loads a CA roots file
scope
=
'https://www.googleapis.com/auth/grpc-testing'
scope
=
'https://www.googleapis.com/auth/grpc-testing'
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment