Grpc.Core.AuthContext.html 13 KB

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