Grpc.Auth.GoogleGrpcCredentials.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316
  1. <!DOCTYPE html>
  2. <!--[if IE]><![endif]-->
  3. <html>
  4. <head>
  5. <meta charset="utf-8">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <title>Class GoogleGrpcCredentials
  8. | gRPC C# </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class GoogleGrpcCredentials
  11. | gRPC C# ">
  12. <meta name="generator" content="docfx 2.23.1.0">
  13. <link rel="shortcut icon" href="../favicon.ico">
  14. <link rel="stylesheet" href="../styles/docfx.vendor.css">
  15. <link rel="stylesheet" href="../styles/docfx.css">
  16. <link rel="stylesheet" href="../styles/main.css">
  17. <meta property="docfx:navrel" content="../toc.html">
  18. <meta property="docfx:tocrel" content="toc.html">
  19. <meta property="docfx:rel" content="../">
  20. </head>
  21. <body data-spy="scroll" data-target="#affix">
  22. <div id="wrapper">
  23. <header>
  24. <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
  25. <div class="container">
  26. <div class="navbar-header">
  27. <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
  28. <span class="sr-only">Toggle navigation</span>
  29. <span class="icon-bar"></span>
  30. <span class="icon-bar"></span>
  31. <span class="icon-bar"></span>
  32. </button>
  33. <a class="navbar-brand" href="../index.html">
  34. <img id="logo" class="svg" src="../logo.svg" alt="">
  35. </a>
  36. </div>
  37. <div class="collapse navbar-collapse" id="navbar">
  38. <form class="navbar-form navbar-right" role="search" id="search">
  39. <div class="form-group">
  40. <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
  41. </div>
  42. </form>
  43. </div>
  44. </div>
  45. </nav>
  46. <div class="subnav navbar navbar-default">
  47. <div class="container hide-when-search" id="breadcrumb">
  48. <ul class="breadcrumb">
  49. <li></li>
  50. </ul>
  51. </div>
  52. </div>
  53. </header>
  54. <div class="container body-content">
  55. <div id="search-results">
  56. <div class="search-list"></div>
  57. <div class="sr-items"></div>
  58. <ul id="pagination"></ul>
  59. </div>
  60. </div>
  61. <div role="main" class="container body-content hide-when-search">
  62. <div class="sidenav hide-when-search">
  63. <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
  64. <div class="sidetoggle collapse" id="sidetoggle">
  65. <div id="sidetoc"></div>
  66. </div>
  67. </div>
  68. <div class="article row grid-right">
  69. <div class="col-md-10">
  70. <article class="content wrap" id="_content" data-uid="Grpc.Auth.GoogleGrpcCredentials">
  71. <h1 id="Grpc_Auth_GoogleGrpcCredentials" data-uid="Grpc.Auth.GoogleGrpcCredentials" class="text-break">Class GoogleGrpcCredentials
  72. </h1>
  73. <div class="markdown level0 summary"><p>Factory/extension methods to create instances of <a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a> and <a class="xref" href="Grpc.Core.CallCredentials.html">CallCredentials</a> classes
  74. based on credential objects originating from Google auth library.</p>
  75. </div>
  76. <div class="markdown level0 conceptual"></div>
  77. <div class="inheritance">
  78. <h5>Inheritance</h5>
  79. <div class="level0"><span class="xref">System.Object</span></div>
  80. <div class="level1"><span class="xref">GoogleGrpcCredentials</span></div>
  81. </div>
  82. <div class="inheritedMembers">
  83. <h5>Inherited Members</h5>
  84. <div>
  85. <span class="xref">System.Object.ToString()</span>
  86. </div>
  87. <div>
  88. <span class="xref">System.Object.Equals(System.Object)</span>
  89. </div>
  90. <div>
  91. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  92. </div>
  93. <div>
  94. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  95. </div>
  96. <div>
  97. <span class="xref">System.Object.GetHashCode()</span>
  98. </div>
  99. <div>
  100. <span class="xref">System.Object.GetType()</span>
  101. </div>
  102. <div>
  103. <span class="xref">System.Object.MemberwiseClone()</span>
  104. </div>
  105. </div>
  106. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Auth.html">Grpc.Auth</a></h6>
  107. <h6><strong>Assembly</strong>: Grpc.Auth.dll</h6>
  108. <h5 id="Grpc_Auth_GoogleGrpcCredentials_syntax">Syntax</h5>
  109. <div class="codewrapper">
  110. <pre><code class="lang-csharp hljs">public static class GoogleGrpcCredentials</code></pre>
  111. </div>
  112. <h3 id="methods">Methods
  113. </h3>
  114. <a id="Grpc_Auth_GoogleGrpcCredentials_FromAccessToken_" data-uid="Grpc.Auth.GoogleGrpcCredentials.FromAccessToken*"></a>
  115. <h4 id="Grpc_Auth_GoogleGrpcCredentials_FromAccessToken_System_String_" data-uid="Grpc.Auth.GoogleGrpcCredentials.FromAccessToken(System.String)">FromAccessToken(String)</h4>
  116. <div class="markdown level1 summary"><p>Creates an instance of <a class="xref" href="Grpc.Core.CallCredentials.html">CallCredentials</a> that will use given access token to authenticate
  117. with a gRPC service.</p>
  118. </div>
  119. <div class="markdown level1 conceptual"></div>
  120. <h5 class="decalaration">Declaration</h5>
  121. <div class="codewrapper">
  122. <pre><code class="lang-csharp hljs">public static CallCredentials FromAccessToken(string accessToken)</code></pre>
  123. </div>
  124. <h5 class="parameters">Parameters</h5>
  125. <table class="table table-bordered table-striped table-condensed">
  126. <thead>
  127. <tr>
  128. <th>Type</th>
  129. <th>Name</th>
  130. <th>Description</th>
  131. </tr>
  132. </thead>
  133. <tbody>
  134. <tr>
  135. <td><span class="xref">System.String</span></td>
  136. <td><span class="parametername">accessToken</span></td>
  137. <td><p>OAuth2 access token.</p>
  138. </td>
  139. </tr>
  140. </tbody>
  141. </table>
  142. <h5 class="returns">Returns</h5>
  143. <table class="table table-bordered table-striped table-condensed">
  144. <thead>
  145. <tr>
  146. <th>Type</th>
  147. <th>Description</th>
  148. </tr>
  149. </thead>
  150. <tbody>
  151. <tr>
  152. <td><a class="xref" href="Grpc.Core.CallCredentials.html">CallCredentials</a></td>
  153. <td><p>The <code>MetadataCredentials</code> instance.</p>
  154. </td>
  155. </tr>
  156. </tbody>
  157. </table>
  158. <a id="Grpc_Auth_GoogleGrpcCredentials_GetApplicationDefaultAsync_" data-uid="Grpc.Auth.GoogleGrpcCredentials.GetApplicationDefaultAsync*"></a>
  159. <h4 id="Grpc_Auth_GoogleGrpcCredentials_GetApplicationDefaultAsync" data-uid="Grpc.Auth.GoogleGrpcCredentials.GetApplicationDefaultAsync">GetApplicationDefaultAsync()</h4>
  160. <div class="markdown level1 summary"><p>Retrieves an instance of Google&apos;s Application Default Credentials using
  161. <code>GoogleCredential.GetApplicationDefaultAsync()</code> and converts them
  162. into a gRPC <a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a> that use the default SSL credentials.</p>
  163. </div>
  164. <div class="markdown level1 conceptual"></div>
  165. <h5 class="decalaration">Declaration</h5>
  166. <div class="codewrapper">
  167. <pre><code class="lang-csharp hljs">public static Task&lt;ChannelCredentials&gt; GetApplicationDefaultAsync()</code></pre>
  168. </div>
  169. <h5 class="returns">Returns</h5>
  170. <table class="table table-bordered table-striped table-condensed">
  171. <thead>
  172. <tr>
  173. <th>Type</th>
  174. <th>Description</th>
  175. </tr>
  176. </thead>
  177. <tbody>
  178. <tr>
  179. <td><span class="xref">System.Threading.Tasks.Task</span>&lt;<a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a>&gt;</td>
  180. <td><p>The <code>ChannelCredentials</code> instance.</p>
  181. </td>
  182. </tr>
  183. </tbody>
  184. </table>
  185. <a id="Grpc_Auth_GoogleGrpcCredentials_ToCallCredentials_" data-uid="Grpc.Auth.GoogleGrpcCredentials.ToCallCredentials*"></a>
  186. <h4 id="Grpc_Auth_GoogleGrpcCredentials_ToCallCredentials_Google_Apis_Auth_OAuth2_ITokenAccess_" data-uid="Grpc.Auth.GoogleGrpcCredentials.ToCallCredentials(Google.Apis.Auth.OAuth2.ITokenAccess)">ToCallCredentials(ITokenAccess)</h4>
  187. <div class="markdown level1 summary"><p>Converts a <code>ITokenAccess</code> (e.g. <code>GoogleCredential</code>) object
  188. into a gRPC <a class="xref" href="Grpc.Core.CallCredentials.html">CallCredentials</a> object.</p>
  189. </div>
  190. <div class="markdown level1 conceptual"></div>
  191. <h5 class="decalaration">Declaration</h5>
  192. <div class="codewrapper">
  193. <pre><code class="lang-csharp hljs">public static CallCredentials ToCallCredentials(this ITokenAccess credential)</code></pre>
  194. </div>
  195. <h5 class="parameters">Parameters</h5>
  196. <table class="table table-bordered table-striped table-condensed">
  197. <thead>
  198. <tr>
  199. <th>Type</th>
  200. <th>Name</th>
  201. <th>Description</th>
  202. </tr>
  203. </thead>
  204. <tbody>
  205. <tr>
  206. <td><span class="xref">Google.Apis.Auth.OAuth2.ITokenAccess</span></td>
  207. <td><span class="parametername">credential</span></td>
  208. <td><p>The credential to use to obtain access tokens.</p>
  209. </td>
  210. </tr>
  211. </tbody>
  212. </table>
  213. <h5 class="returns">Returns</h5>
  214. <table class="table table-bordered table-striped table-condensed">
  215. <thead>
  216. <tr>
  217. <th>Type</th>
  218. <th>Description</th>
  219. </tr>
  220. </thead>
  221. <tbody>
  222. <tr>
  223. <td><a class="xref" href="Grpc.Core.CallCredentials.html">CallCredentials</a></td>
  224. <td><p>The <code>CallCredentials</code> instance.</p>
  225. </td>
  226. </tr>
  227. </tbody>
  228. </table>
  229. <a id="Grpc_Auth_GoogleGrpcCredentials_ToChannelCredentials_" data-uid="Grpc.Auth.GoogleGrpcCredentials.ToChannelCredentials*"></a>
  230. <h4 id="Grpc_Auth_GoogleGrpcCredentials_ToChannelCredentials_Google_Apis_Auth_OAuth2_ITokenAccess_" data-uid="Grpc.Auth.GoogleGrpcCredentials.ToChannelCredentials(Google.Apis.Auth.OAuth2.ITokenAccess)">ToChannelCredentials(ITokenAccess)</h4>
  231. <div class="markdown level1 summary"><p>Converts a <code>ITokenAccess</code> (e.g. <code>GoogleCredential</code>) object
  232. into a gRPC <a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a> object.
  233. Default SSL credentials are used.</p>
  234. </div>
  235. <div class="markdown level1 conceptual"></div>
  236. <h5 class="decalaration">Declaration</h5>
  237. <div class="codewrapper">
  238. <pre><code class="lang-csharp hljs">public static ChannelCredentials ToChannelCredentials(this ITokenAccess googleCredential)</code></pre>
  239. </div>
  240. <h5 class="parameters">Parameters</h5>
  241. <table class="table table-bordered table-striped table-condensed">
  242. <thead>
  243. <tr>
  244. <th>Type</th>
  245. <th>Name</th>
  246. <th>Description</th>
  247. </tr>
  248. </thead>
  249. <tbody>
  250. <tr>
  251. <td><span class="xref">Google.Apis.Auth.OAuth2.ITokenAccess</span></td>
  252. <td><span class="parametername">googleCredential</span></td>
  253. <td><p>The credential to use to obtain access tokens.</p>
  254. </td>
  255. </tr>
  256. </tbody>
  257. </table>
  258. <h5 class="returns">Returns</h5>
  259. <table class="table table-bordered table-striped table-condensed">
  260. <thead>
  261. <tr>
  262. <th>Type</th>
  263. <th>Description</th>
  264. </tr>
  265. </thead>
  266. <tbody>
  267. <tr>
  268. <td><a class="xref" href="Grpc.Core.ChannelCredentials.html">ChannelCredentials</a></td>
  269. <td><blockquote><p>The <code>ChannelCredentials</code> instance.</p>
  270. </blockquote>
  271. </td>
  272. </tr>
  273. </tbody>
  274. </table>
  275. </article>
  276. </div>
  277. <div class="hidden-sm col-md-2" role="complementary">
  278. <div class="sideaffix">
  279. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  280. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  281. </nav>
  282. </div>
  283. </div>
  284. </div>
  285. </div>
  286. <footer>
  287. <div class="grad-bottom"></div>
  288. <div class="footer">
  289. <div class="container">
  290. <span class="pull-right">
  291. <a href="#top">Back to top</a>
  292. </span>
  293. <span>Copyright © 2015-2017 Microsoft<br>Generated by <strong>DocFX</strong></span>
  294. </div>
  295. </div>
  296. </footer>
  297. </div>
  298. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  299. <script type="text/javascript" src="../styles/docfx.js"></script>
  300. <script type="text/javascript" src="../styles/main.js"></script>
  301. </body>
  302. </html>