Grpc.Core.AuthContext.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  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 for .NET </title>
  9. <meta name="viewport" content="width=device-width">
  10. <meta name="title" content="Class AuthContext
  11. | gRPC for .NET ">
  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. <h6><strong>Namespace</strong>: <a class="xref" href="Grpc.Core.html">Grpc.Core</a></h6>
  87. <h6><strong>Assembly</strong>: Grpc.Core.Api.dll</h6>
  88. <h5 id="Grpc_Core_AuthContext_syntax">Syntax</h5>
  89. <div class="codewrapper">
  90. <pre><code class="lang-csharp hljs">public class AuthContext : object</code></pre>
  91. </div>
  92. <h3 id="constructors">Constructors
  93. </h3>
  94. <a id="Grpc_Core_AuthContext__ctor_" data-uid="Grpc.Core.AuthContext.#ctor*"></a>
  95. <h4 id="Grpc_Core_AuthContext__ctor_System_String_Dictionary_System_String_List_Grpc_Core_AuthProperty___" data-uid="Grpc.Core.AuthContext.#ctor(System.String,Dictionary{System.String,List{Grpc.Core.AuthProperty}})">AuthContext(String, Dictionary&lt;String, List&lt;AuthProperty&gt;&gt;)</h4>
  96. <div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="Grpc.Core.AuthContext.html">AuthContext</a> class.</p>
  97. </div>
  98. <div class="markdown level1 conceptual"></div>
  99. <h5 class="decalaration">Declaration</h5>
  100. <div class="codewrapper">
  101. <pre><code class="lang-csharp hljs">public AuthContext(string peerIdentityPropertyName, Dictionary&lt;string, List&lt;AuthProperty&gt;&gt; properties)</code></pre>
  102. </div>
  103. <h5 class="parameters">Parameters</h5>
  104. <table class="table table-bordered table-striped table-condensed">
  105. <thead>
  106. <tr>
  107. <th>Type</th>
  108. <th>Name</th>
  109. <th>Description</th>
  110. </tr>
  111. </thead>
  112. <tbody>
  113. <tr>
  114. <td><span class="xref">System.String</span></td>
  115. <td><span class="parametername">peerIdentityPropertyName</span></td>
  116. <td><p>Peer identity property name.</p>
  117. </td>
  118. </tr>
  119. <tr>
  120. <td><span class="xref">Dictionary</span>&lt;<span class="xref">System.String</span>, <span class="xref">List</span>&lt;<a class="xref" href="Grpc.Core.AuthProperty.html">AuthProperty</a>&gt;&gt;</td>
  121. <td><span class="parametername">properties</span></td>
  122. <td><p>Multimap of auth properties by name.</p>
  123. </td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. <h3 id="properties">Properties
  128. </h3>
  129. <a id="Grpc_Core_AuthContext_IsPeerAuthenticated_" data-uid="Grpc.Core.AuthContext.IsPeerAuthenticated*"></a>
  130. <h4 id="Grpc_Core_AuthContext_IsPeerAuthenticated" data-uid="Grpc.Core.AuthContext.IsPeerAuthenticated">IsPeerAuthenticated</h4>
  131. <div class="markdown level1 summary"><p>Returns <code>true</code> if the peer is authenticated.</p>
  132. </div>
  133. <div class="markdown level1 conceptual"></div>
  134. <h5 class="decalaration">Declaration</h5>
  135. <div class="codewrapper">
  136. <pre><code class="lang-csharp hljs">public bool IsPeerAuthenticated { get; }</code></pre>
  137. </div>
  138. <h5 class="propertyValue">Property Value</h5>
  139. <table class="table table-bordered table-striped table-condensed">
  140. <thead>
  141. <tr>
  142. <th>Type</th>
  143. <th>Description</th>
  144. </tr>
  145. </thead>
  146. <tbody>
  147. <tr>
  148. <td><span class="xref">System.Boolean</span></td>
  149. <td></td>
  150. </tr>
  151. </tbody>
  152. </table>
  153. <a id="Grpc_Core_AuthContext_PeerIdentity_" data-uid="Grpc.Core.AuthContext.PeerIdentity*"></a>
  154. <h4 id="Grpc_Core_AuthContext_PeerIdentity" data-uid="Grpc.Core.AuthContext.PeerIdentity">PeerIdentity</h4>
  155. <div class="markdown level1 summary"><p>Gets properties that represent the peer identity (there can be more than one). Returns an empty collection
  156. if the peer is not authenticated.</p>
  157. </div>
  158. <div class="markdown level1 conceptual"></div>
  159. <h5 class="decalaration">Declaration</h5>
  160. <div class="codewrapper">
  161. <pre><code class="lang-csharp hljs">public IEnumerable&lt;AuthProperty&gt; PeerIdentity { get; }</code></pre>
  162. </div>
  163. <h5 class="propertyValue">Property Value</h5>
  164. <table class="table table-bordered table-striped table-condensed">
  165. <thead>
  166. <tr>
  167. <th>Type</th>
  168. <th>Description</th>
  169. </tr>
  170. </thead>
  171. <tbody>
  172. <tr>
  173. <td><span class="xref">IEnumerable</span>&lt;<a class="xref" href="Grpc.Core.AuthProperty.html">AuthProperty</a>&gt;</td>
  174. <td></td>
  175. </tr>
  176. </tbody>
  177. </table>
  178. <a id="Grpc_Core_AuthContext_PeerIdentityPropertyName_" data-uid="Grpc.Core.AuthContext.PeerIdentityPropertyName*"></a>
  179. <h4 id="Grpc_Core_AuthContext_PeerIdentityPropertyName" data-uid="Grpc.Core.AuthContext.PeerIdentityPropertyName">PeerIdentityPropertyName</h4>
  180. <div class="markdown level1 summary"><p>Gets the name of the property that indicates the peer identity. Returns <code>null</code>
  181. if the peer is not authenticated.</p>
  182. </div>
  183. <div class="markdown level1 conceptual"></div>
  184. <h5 class="decalaration">Declaration</h5>
  185. <div class="codewrapper">
  186. <pre><code class="lang-csharp hljs">public string PeerIdentityPropertyName { get; }</code></pre>
  187. </div>
  188. <h5 class="propertyValue">Property Value</h5>
  189. <table class="table table-bordered table-striped table-condensed">
  190. <thead>
  191. <tr>
  192. <th>Type</th>
  193. <th>Description</th>
  194. </tr>
  195. </thead>
  196. <tbody>
  197. <tr>
  198. <td><span class="xref">System.String</span></td>
  199. <td></td>
  200. </tr>
  201. </tbody>
  202. </table>
  203. <a id="Grpc_Core_AuthContext_Properties_" data-uid="Grpc.Core.AuthContext.Properties*"></a>
  204. <h4 id="Grpc_Core_AuthContext_Properties" data-uid="Grpc.Core.AuthContext.Properties">Properties</h4>
  205. <div class="markdown level1 summary"><p>Gets the auth properties of this context.</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 IEnumerable&lt;AuthProperty&gt; Properties { 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">IEnumerable</span>&lt;<a class="xref" href="Grpc.Core.AuthProperty.html">AuthProperty</a>&gt;</td>
  223. <td></td>
  224. </tr>
  225. </tbody>
  226. </table>
  227. <h3 id="methods">Methods
  228. </h3>
  229. <a id="Grpc_Core_AuthContext_FindPropertiesByName_" data-uid="Grpc.Core.AuthContext.FindPropertiesByName*"></a>
  230. <h4 id="Grpc_Core_AuthContext_FindPropertiesByName_System_String_" data-uid="Grpc.Core.AuthContext.FindPropertiesByName(System.String)">FindPropertiesByName(String)</h4>
  231. <div class="markdown level1 summary"><p>Returns the auth properties with given name (there can be more than one).
  232. If no properties of given name exist, an empty collection will be returned.</p>
  233. </div>
  234. <div class="markdown level1 conceptual"></div>
  235. <h5 class="decalaration">Declaration</h5>
  236. <div class="codewrapper">
  237. <pre><code class="lang-csharp hljs">public IEnumerable&lt;AuthProperty&gt; FindPropertiesByName(string propertyName)</code></pre>
  238. </div>
  239. <h5 class="parameters">Parameters</h5>
  240. <table class="table table-bordered table-striped table-condensed">
  241. <thead>
  242. <tr>
  243. <th>Type</th>
  244. <th>Name</th>
  245. <th>Description</th>
  246. </tr>
  247. </thead>
  248. <tbody>
  249. <tr>
  250. <td><span class="xref">System.String</span></td>
  251. <td><span class="parametername">propertyName</span></td>
  252. <td></td>
  253. </tr>
  254. </tbody>
  255. </table>
  256. <h5 class="returns">Returns</h5>
  257. <table class="table table-bordered table-striped table-condensed">
  258. <thead>
  259. <tr>
  260. <th>Type</th>
  261. <th>Description</th>
  262. </tr>
  263. </thead>
  264. <tbody>
  265. <tr>
  266. <td><span class="xref">IEnumerable</span>&lt;<a class="xref" href="Grpc.Core.AuthProperty.html">AuthProperty</a>&gt;</td>
  267. <td></td>
  268. </tr>
  269. </tbody>
  270. </table>
  271. </article>
  272. </div>
  273. <div class="hidden-sm col-md-2" role="complementary">
  274. <div class="sideaffix">
  275. <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
  276. <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
  277. </nav>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. <footer>
  283. <div class="grad-bottom"></div>
  284. <div class="footer">
  285. <div class="container">
  286. <span class="pull-right">
  287. <a href="#top">Back to top</a>
  288. </span>
  289. <span>Generated by <strong>DocFX</strong></span>
  290. </div>
  291. </div>
  292. </footer>
  293. </div>
  294. <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
  295. <script type="text/javascript" src="../styles/docfx.js"></script>
  296. <script type="text/javascript" src="../styles/main.js"></script>
  297. </body>
  298. </html>