Grpc.Core.AuthContext.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  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 AuthContext
  8. | gRPC C# </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class AuthContext
  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.Core.AuthContext">
  71. <h1 id="Grpc_Core_AuthContext" data-uid="Grpc.Core.AuthContext" class="text-break">Class AuthContext
  72. </h1>
  73. <div class="markdown level0 summary"><p>Authentication context for a call.
  74. AuthContext is the only reliable source of truth when it comes to authenticating calls.
  75. Using any other call/context properties for authentication purposes is wrong and inherently unsafe.
  76. Note: experimental API that can change or be removed without any prior notice.</p>
  77. </div>
  78. <div class="markdown level0 conceptual"></div>
  79. <div class="inheritance">
  80. <h5>Inheritance</h5>
  81. <div class="level0"><span class="xref">System.Object</span></div>
  82. <div class="level1"><span class="xref">AuthContext</span></div>
  83. </div>
  84. <div class="inheritedMembers">
  85. <h5>Inherited Members</h5>
  86. <div>
  87. <span class="xref">System.Object.ToString()</span>
  88. </div>
  89. <div>
  90. <span class="xref">System.Object.Equals(System.Object)</span>
  91. </div>
  92. <div>
  93. <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
  94. </div>
  95. <div>
  96. <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
  97. </div>
  98. <div>
  99. <span class="xref">System.Object.GetHashCode()</span>
  100. </div>
  101. <div>
  102. <span class="xref">System.Object.GetType()</span>
  103. </div>
  104. <div>
  105. <span class="xref">System.Object.MemberwiseClone()</span>
  106. </div>
  107. </div>
  108. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Core.html">Grpc.Core</a></h6>
  109. <h6><strong>Assembly</strong>: Grpc.Core.dll</h6>
  110. <h5 id="Grpc_Core_AuthContext_syntax">Syntax</h5>
  111. <div class="codewrapper">
  112. <pre><code class="lang-csharp hljs">public class AuthContext</code></pre>
  113. </div>
  114. <h3 id="properties">Properties
  115. </h3>
  116. <a id="Grpc_Core_AuthContext_IsPeerAuthenticated_" data-uid="Grpc.Core.AuthContext.IsPeerAuthenticated*"></a>
  117. <h4 id="Grpc_Core_AuthContext_IsPeerAuthenticated" data-uid="Grpc.Core.AuthContext.IsPeerAuthenticated">IsPeerAuthenticated</h4>
  118. <div class="markdown level1 summary"><p>Returns <code>true</code> if the peer is authenticated.</p>
  119. </div>
  120. <div class="markdown level1 conceptual"></div>
  121. <h5 class="decalaration">Declaration</h5>
  122. <div class="codewrapper">
  123. <pre><code class="lang-csharp hljs">public bool IsPeerAuthenticated { get; }</code></pre>
  124. </div>
  125. <h5 class="propertyValue">Property Value</h5>
  126. <table class="table table-bordered table-striped table-condensed">
  127. <thead>
  128. <tr>
  129. <th>Type</th>
  130. <th>Description</th>
  131. </tr>
  132. </thead>
  133. <tbody>
  134. <tr>
  135. <td><span class="xref">System.Boolean</span></td>
  136. <td></td>
  137. </tr>
  138. </tbody>
  139. </table>
  140. <a id="Grpc_Core_AuthContext_PeerIdentity_" data-uid="Grpc.Core.AuthContext.PeerIdentity*"></a>
  141. <h4 id="Grpc_Core_AuthContext_PeerIdentity" data-uid="Grpc.Core.AuthContext.PeerIdentity">PeerIdentity</h4>
  142. <div class="markdown level1 summary"><p>Gets properties that represent the peer identity (there can be more than one). Returns an empty collection
  143. if the peer is not authenticated.</p>
  144. </div>
  145. <div class="markdown level1 conceptual"></div>
  146. <h5 class="decalaration">Declaration</h5>
  147. <div class="codewrapper">
  148. <pre><code class="lang-csharp hljs">public IEnumerable&lt;AuthProperty&gt; PeerIdentity { get; }</code></pre>
  149. </div>
  150. <h5 class="propertyValue">Property Value</h5>
  151. <table class="table table-bordered table-striped table-condensed">
  152. <thead>
  153. <tr>
  154. <th>Type</th>
  155. <th>Description</th>
  156. </tr>
  157. </thead>
  158. <tbody>
  159. <tr>
  160. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;<a class="xref" href="Grpc.Core.AuthProperty.html">AuthProperty</a>&gt;</td>
  161. <td></td>
  162. </tr>
  163. </tbody>
  164. </table>
  165. <a id="Grpc_Core_AuthContext_PeerIdentityPropertyName_" data-uid="Grpc.Core.AuthContext.PeerIdentityPropertyName*"></a>
  166. <h4 id="Grpc_Core_AuthContext_PeerIdentityPropertyName" data-uid="Grpc.Core.AuthContext.PeerIdentityPropertyName">PeerIdentityPropertyName</h4>
  167. <div class="markdown level1 summary"><p>Gets the name of the property that indicates the peer identity. Returns <code>null</code>
  168. if the peer is not authenticated.</p>
  169. </div>
  170. <div class="markdown level1 conceptual"></div>
  171. <h5 class="decalaration">Declaration</h5>
  172. <div class="codewrapper">
  173. <pre><code class="lang-csharp hljs">public string PeerIdentityPropertyName { get; }</code></pre>
  174. </div>
  175. <h5 class="propertyValue">Property Value</h5>
  176. <table class="table table-bordered table-striped table-condensed">
  177. <thead>
  178. <tr>
  179. <th>Type</th>
  180. <th>Description</th>
  181. </tr>
  182. </thead>
  183. <tbody>
  184. <tr>
  185. <td><span class="xref">System.String</span></td>
  186. <td></td>
  187. </tr>
  188. </tbody>
  189. </table>
  190. <a id="Grpc_Core_AuthContext_Properties_" data-uid="Grpc.Core.AuthContext.Properties*"></a>
  191. <h4 id="Grpc_Core_AuthContext_Properties" data-uid="Grpc.Core.AuthContext.Properties">Properties</h4>
  192. <div class="markdown level1 summary"><p>Gets the auth properties of this context.</p>
  193. </div>
  194. <div class="markdown level1 conceptual"></div>
  195. <h5 class="decalaration">Declaration</h5>
  196. <div class="codewrapper">
  197. <pre><code class="lang-csharp hljs">public IEnumerable&lt;AuthProperty&gt; Properties { get; }</code></pre>
  198. </div>
  199. <h5 class="propertyValue">Property Value</h5>
  200. <table class="table table-bordered table-striped table-condensed">
  201. <thead>
  202. <tr>
  203. <th>Type</th>
  204. <th>Description</th>
  205. </tr>
  206. </thead>
  207. <tbody>
  208. <tr>
  209. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;<a class="xref" href="Grpc.Core.AuthProperty.html">AuthProperty</a>&gt;</td>
  210. <td></td>
  211. </tr>
  212. </tbody>
  213. </table>
  214. <h3 id="methods">Methods
  215. </h3>
  216. <a id="Grpc_Core_AuthContext_FindPropertiesByName_" data-uid="Grpc.Core.AuthContext.FindPropertiesByName*"></a>
  217. <h4 id="Grpc_Core_AuthContext_FindPropertiesByName_System_String_" data-uid="Grpc.Core.AuthContext.FindPropertiesByName(System.String)">FindPropertiesByName(String)</h4>
  218. <div class="markdown level1 summary"><p>Returns the auth properties with given name (there can be more than one).
  219. If no properties of given name exist, an empty collection will be returned.</p>
  220. </div>
  221. <div class="markdown level1 conceptual"></div>
  222. <h5 class="decalaration">Declaration</h5>
  223. <div class="codewrapper">
  224. <pre><code class="lang-csharp hljs">public IEnumerable&lt;AuthProperty&gt; FindPropertiesByName(string propertyName)</code></pre>
  225. </div>
  226. <h5 class="parameters">Parameters</h5>
  227. <table class="table table-bordered table-striped table-condensed">
  228. <thead>
  229. <tr>
  230. <th>Type</th>
  231. <th>Name</th>
  232. <th>Description</th>
  233. </tr>
  234. </thead>
  235. <tbody>
  236. <tr>
  237. <td><span class="xref">System.String</span></td>
  238. <td><span class="parametername">propertyName</span></td>
  239. <td></td>
  240. </tr>
  241. </tbody>
  242. </table>
  243. <h5 class="returns">Returns</h5>
  244. <table class="table table-bordered table-striped table-condensed">
  245. <thead>
  246. <tr>
  247. <th>Type</th>
  248. <th>Description</th>
  249. </tr>
  250. </thead>
  251. <tbody>
  252. <tr>
  253. <td><span class="xref">System.Collections.Generic.IEnumerable</span>&lt;<a class="xref" href="Grpc.Core.AuthProperty.html">AuthProperty</a>&gt;</td>
  254. <td></td>
  255. </tr>
  256. </tbody>
  257. </table>
  258. </article>
  259. </div>
  260. <div class="hidden-sm col-md-2" role="complementary">
  261. <div class="sideaffix">
  262. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  263. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  264. </nav>
  265. </div>
  266. </div>
  267. </div>
  268. </div>
  269. <footer>
  270. <div class="grad-bottom"></div>
  271. <div class="footer">
  272. <div class="container">
  273. <span class="pull-right">
  274. <a href="#top">Back to top</a>
  275. </span>
  276. <span>Copyright © 2015-2017 Microsoft<br>Generated by <strong>DocFX</strong></span>
  277. </div>
  278. </div>
  279. </footer>
  280. </div>
  281. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  282. <script type="text/javascript" src="../styles/docfx.js"></script>
  283. <script type="text/javascript" src="../styles/main.js"></script>
  284. </body>
  285. </html>