Files
stacks.js/docs/modules/auth.html
2021-06-28 10:27:07 -07:00

487 lines
32 KiB
HTML
Vendored

<!doctype html>
<html class="default no-js">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>auth | Stacks.js 1.4.1 Library Reference</title>
<meta name="description" content="Documentation for Stacks.js 1.4.1 Library Reference">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="../assets/css/main.css">
<script async src="../assets/js/search.js" id="search-script"></script>
</head>
<body>
<header>
<div class="tsd-page-toolbar">
<div class="container">
<div class="table-wrap">
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
<div class="field">
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
<input id="tsd-search-field" type="text" />
</div>
<ul class="results">
<li class="state loading">Preparing search index...</li>
<li class="state failure">The search index is not available</li>
</ul>
<a href="../index.html" class="title">Stacks.js 1.4.1 Library Reference</a>
</div>
<div class="table-cell" id="tsd-widgets">
<div id="tsd-filter">
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
<div class="tsd-filter-group">
<div class="tsd-select" id="tsd-filter-visibility">
<span class="tsd-select-label">All</span>
<ul class="tsd-select-list">
<li data-value="public">Public</li>
<li data-value="protected">Public/Protected</li>
<li data-value="private" class="selected">All</li>
</ul>
</div>
<input type="checkbox" id="tsd-filter-inherited" checked />
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
<input type="checkbox" id="tsd-filter-externals" checked />
<label class="tsd-widget" for="tsd-filter-externals">Externals</label>
</div>
</div>
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
</div>
</div>
</div>
</div>
<div class="tsd-page-title">
<div class="container">
<ul class="tsd-breadcrumb">
<li>
<a href="../modules.html">Stacks.js 1.4.1 Library Reference</a>
</li>
<li>
<a href="auth.html">auth</a>
</li>
</ul>
<h1>Module auth</h1>
</div>
</div>
</header>
<div class="container container-main">
<div class="row">
<div class="col-8 col-content">
<section class="tsd-panel tsd-comment">
<div class="tsd-comment tsd-typography">
<a href="#stacksauth" id="stacksauth" style="color: inherit; text-decoration: none;">
<h1>@stacks/auth</h1>
</a>
<p>Construct and decode authentication requests for Stacks apps. </p>
<p>This package provides the auth logic used by the <a href="https://github.com/blockstack/ux/tree/master/packages/connect">Stacks Connect</a> library. If you&#39;re looking to integrate Stacks authentication into your web app, Stacks Connect provides a simple API and built-in user interface. See the <a href="https://docs.blockstack.org/authentication/building-todo-app">authentication tutorial</a>. </p>
<a href="#installation" id="installation" style="color: inherit; text-decoration: none;">
<h2>Installation</h2>
</a>
<pre><code><span style="color: #001080">npm</span><span style="color: #000000"> </span><span style="color: #001080">install</span><span style="color: #000000"> @</span><span style="color: #001080">stacks</span><span style="color: #000000">/</span><span style="color: #001080">auth</span>
</code></pre>
<a href="#usage" id="usage" style="color: inherit; text-decoration: none;">
<h2>Usage</h2>
</a>
<a href="#generating-an-authentication-request" id="generating-an-authentication-request" style="color: inherit; text-decoration: none;">
<h3>Generating an authentication request</h3>
</a>
<pre><code class="language-typescript"><span style="color: #AF00DB">import</span><span style="color: #000000"> { </span><span style="color: #001080">UserSession</span><span style="color: #000000">, </span><span style="color: #001080">makeAuthRequest</span><span style="color: #000000">, </span><span style="color: #001080">AppConfig</span><span style="color: #000000"> } </span><span style="color: #AF00DB">from</span><span style="color: #000000"> </span><span style="color: #A31515">&#039;@stacks/auth&#039;</span>
</code></pre>
<p>The app domain is the URL to your website/app. This is how the Stacks authentication system identifies apps and determines what credentials to provide. Changing the app domain is equivalent to changing the app. Note that you also need to have a valid manifest.json file at the domain.</p>
<pre><code class="language-typescript"><span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">appDomain</span><span style="color: #000000"> = </span><span style="color: #A31515">&#039;https://www.myapp.com&#039;</span><span style="color: #000000">;</span>
</code></pre>
<p>Next we set the basic permissions for your app to read and store user data. If your app will allow users to share data with other users, you will need an additional <code>publish_data</code> permission. We will also initiate a <code>UserSession</code> object using the configuration.</p>
<pre><code class="language-typescript"><span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">appConfig</span><span style="color: #000000"> = </span><span style="color: #0000FF">new</span><span style="color: #000000"> </span><span style="color: #795E26">AppConfig</span><span style="color: #000000">([</span><span style="color: #A31515">&#039;store_write&#039;</span><span style="color: #000000">], </span><span style="color: #001080">appDomain</span><span style="color: #000000">);</span>
<span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">userSession</span><span style="color: #000000"> = </span><span style="color: #0000FF">new</span><span style="color: #000000"> </span><span style="color: #795E26">UserSession</span><span style="color: #000000">({ </span><span style="color: #001080">appConfig</span><span style="color: #000000"> });</span>
</code></pre>
<p>The authentication payloads are encrypted during transit, the encryption key generated below provides this</p>
<pre><code class="language-typescript"><span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">transitKey</span><span style="color: #000000"> = </span><span style="color: #001080">userSession</span><span style="color: #000000">.</span><span style="color: #795E26">generateAndStoreTransitKey</span><span style="color: #000000">();</span>
</code></pre>
<p>The Stacks auth process will open a compatible Stacks authenticator or browser extension to perform the authentication. So you will need to provide a redirect URL which the authenticator or extension can redirect to with the authentication payload. This page should process the authentication payload. </p>
<pre><code class="language-typescript"><span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">redirectUri</span><span style="color: #000000"> = </span><span style="color: #A31515">&#039;https://www.myapp.com/auth&#039;</span><span style="color: #000000">;</span>
</code></pre>
<p>Set the location of your app manifest file. This file contains information about your app that is shown to the user during authentication.</p>
<pre><code class="language-typescript"><span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">manifestUri</span><span style="color: #000000"> = </span><span style="color: #A31515">&#039;https://www.myapp.com/manifest.json&#039;</span><span style="color: #000000">;</span>
</code></pre>
<p>Finally generate the authentication request payload:</p>
<pre><code class="language-typescript"><span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">authRequest</span><span style="color: #000000"> = </span><span style="color: #001080">userSession</span><span style="color: #000000">.</span><span style="color: #795E26">makeAuthRequest</span><span style="color: #000000">(</span>
<span style="color: #000000"> </span><span style="color: #001080">transitKey</span><span style="color: #000000">,</span>
<span style="color: #000000"> </span><span style="color: #001080">redirectUri</span><span style="color: #000000">,</span>
<span style="color: #000000"> </span><span style="color: #001080">manifestUri</span>
<span style="color: #000000">);</span>
</code></pre>
<p>The resulting payload can now be passed to a compatible Stacks authenticator or browser extension. If you are using Stacks connect, this is performed automatically. </p>
<p>If you would like to implement a Stacks authenticator, check out the reference implementation of the <a href="https://github.com/blockstack/ux/tree/master/packages/app">Stacks browser extension</a>.</p>
<a href="#handling-an-authentication-response-payload" id="handling-an-authentication-response-payload" style="color: inherit; text-decoration: none;">
<h3>Handling an authentication response payload</h3>
</a>
<p>After an authenticator has processed your app&#39;s request, and the user has granted permission, the resulting response will be passed back to your app via the URL set in your <code>redirectUri</code>.</p>
<p>Below, we use <code>userSession.isSignInPending</code> to determine if there is an incoming authentication response. If detected, the <code>userSession.handlePendingSignIn</code> method will process the response and provide a <code>userData</code> object containing the user&#39;s identity, BNS username and profile information.</p>
<pre><code class="language-typescript"><span style="color: #AF00DB">if</span><span style="color: #000000"> (</span><span style="color: #001080">userSession</span><span style="color: #000000">.</span><span style="color: #795E26">isSignInPending</span><span style="color: #000000">()) {</span>
<span style="color: #000000"> </span><span style="color: #001080">userSession</span><span style="color: #000000">.</span><span style="color: #795E26">handlePendingSignIn</span><span style="color: #000000">().</span><span style="color: #795E26">then</span><span style="color: #000000">((</span><span style="color: #001080">userData</span><span style="color: #000000">) </span><span style="color: #0000FF">=&gt;</span><span style="color: #000000"> {</span>
<span style="color: #000000"> </span><span style="color: #008000">// Do something with userData</span>
<span style="color: #000000"> });</span>
<span style="color: #000000">}</span>
</code></pre>
<a href="#checking-if-the-user-is-signed-in" id="checking-if-the-user-is-signed-in" style="color: inherit; text-decoration: none;">
<h3>Checking if the user is signed in</h3>
</a>
<p>Use the <code>userSession.isUserSignedIn</code> method to check if the user is already authenticated. If so, we can retrieve the user&#39;s profile data using <code>userSession.loadUserData</code>.</p>
<pre><code class="language-typescript"><span style="color: #AF00DB">if</span><span style="color: #000000"> (</span><span style="color: #001080">userSession</span><span style="color: #000000">.</span><span style="color: #795E26">isUserSignedIn</span><span style="color: #000000">()) {</span>
<span style="color: #000000"> </span><span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">userData</span><span style="color: #000000"> = </span><span style="color: #001080">userSession</span><span style="color: #000000">.</span><span style="color: #795E26">loadUserData</span><span style="color: #000000">();</span>
<span style="color: #000000">}</span>
</code></pre>
<a href="#sign-out" id="sign-out" style="color: inherit; text-decoration: none;">
<h3>Sign out</h3>
</a>
<p>To sign the user out simply call the <code>userSession.signUserOut</code> method.</p>
<pre><code class="language-typescript"><span style="color: #001080">userSession</span><span style="color: #000000">.</span><span style="color: #795E26">signUserOut</span><span style="color: #000000">();</span>
</code></pre>
<a href="#data-encryption" id="data-encryption" style="color: inherit; text-decoration: none;">
<h3>Data encryption</h3>
</a>
<p>Stacks authentication also provides an easy way to encrypt the user&#39;s data. If you are using the <a href="https://github.com/blockstack/stacks.js/tree/master/packages/storage"><code>@stacks/storage</code></a> package, encryption is automatically enabled. If you would like to perform encryption outside of storage you can use the <code>userSession.encryptContent</code> and <code>userSession.decryptContent</code> methods.</p>
<pre><code class="language-typescript"><span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">message</span><span style="color: #000000"> = </span><span style="color: #A31515">&#039;My secret message&#039;</span><span style="color: #000000">;</span>
<span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">cipherText</span><span style="color: #000000"> = </span><span style="color: #AF00DB">await</span><span style="color: #000000"> </span><span style="color: #001080">userSession</span><span style="color: #000000">.</span><span style="color: #795E26">encryptContent</span><span style="color: #000000">(</span><span style="color: #001080">message</span><span style="color: #000000">);</span>
<span style="color: #0000FF">const</span><span style="color: #000000"> </span><span style="color: #0070C1">plainText</span><span style="color: #000000"> = </span><span style="color: #AF00DB">await</span><span style="color: #000000"> </span><span style="color: #001080">userSession</span><span style="color: #000000">.</span><span style="color: #795E26">decryptContent</span><span style="color: #000000">(</span><span style="color: #001080">cipherText</span><span style="color: #000000">);</span>
</code></pre>
<p>Note that encryption here uses the user&#39;s private key associated with your app only. If you need to share this data with another app or other users, you should use the equivalent methods from <code>@stacks/encryption</code> and provide a custom private key.</p>
</div>
</section>
<section class="tsd-panel-group tsd-index-group">
<h2>Index</h2>
<section class="tsd-panel tsd-index-panel">
<div class="tsd-index-content">
<section class="tsd-index-section ">
<h3>Enumerations</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-enum tsd-parent-kind-module"><a href="../enums/auth.authscope.html" class="tsd-kind-icon">Auth<wbr>Scope</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Classes</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/auth.appconfig.html" class="tsd-kind-icon">App<wbr>Config</a></li>
<li class="tsd-kind-class tsd-parent-kind-module"><a href="../classes/auth.usersession.html" class="tsd-kind-icon">User<wbr>Session</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Interfaces</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/auth.profilelookupoptions.html" class="tsd-kind-icon">Profile<wbr>Lookup<wbr>Options</a></li>
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/auth.userdata.html" class="tsd-kind-icon">User<wbr>Data</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Variables</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-variable tsd-parent-kind-module"><a href="auth.html#default_blockstack_host" class="tsd-kind-icon">DEFAULT_<wbr>BLOCKSTACK_<wbr>HOST</a></li>
<li class="tsd-kind-variable tsd-parent-kind-module"><a href="auth.html#default_profile" class="tsd-kind-icon">DEFAULT_<wbr>PROFILE</a></li>
</ul>
</section>
<section class="tsd-index-section ">
<h3>Functions</h3>
<ul class="tsd-index-list">
<li class="tsd-kind-function tsd-parent-kind-module"><a href="auth.html#lookupprofile" class="tsd-kind-icon">lookup<wbr>Profile</a></li>
<li class="tsd-kind-function tsd-parent-kind-module"><a href="auth.html#makeauthrequest" class="tsd-kind-icon">make<wbr>Auth<wbr>Request</a></li>
</ul>
</section>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Variables</h2>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module">
<a name="default_blockstack_host" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> DEFAULT_<wbr>BLOCKSTACK_<wbr>HOST</h3>
<div class="tsd-signature tsd-kind-icon">DEFAULT_<wbr>BLOCKSTACK_<wbr>HOST<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">&quot;https://browser.blockstack.org/auth&quot;</span><span class="tsd-signature-symbol"> = &#x27;https://browser.blockstack.org/auth&#x27;</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/auth/src/constants.ts#L12">packages/auth/src/constants.ts:12</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>This constant is used in the [[redirectToSignInWithAuthRequest]]</p>
</div>
</div>
</section>
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-module">
<a name="default_profile" class="tsd-anchor"></a>
<h3><span class="tsd-flag ts-flagConst">Const</span> DEFAULT_<wbr>PROFILE</h3>
<div class="tsd-signature tsd-kind-icon">DEFAULT_<wbr>PROFILE<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span>@context<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">; </span>@type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> }</span><span class="tsd-signature-symbol"> = ...</span></div>
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/auth/src/constants.ts#L17">packages/auth/src/constants.ts:17</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Default user profile object</p>
</div>
</div>
<div class="tsd-type-declaration">
<h4>Type declaration</h4>
<ul class="tsd-parameters">
<li class="tsd-parameter">
<h5>@context<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
<li class="tsd-parameter">
<h5>@type<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></h5>
</li>
</ul>
</div>
</section>
</section>
<section class="tsd-panel-group tsd-member-group ">
<h2>Functions</h2>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="lookupprofile" class="tsd-anchor"></a>
<h3>lookup<wbr>Profile</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">lookup<wbr>Profile<span class="tsd-signature-symbol">(</span>options<span class="tsd-signature-symbol">: </span><a href="../interfaces/auth.profilelookupoptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ProfileLookupOptions</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/auth/src/profile.ts#L20">packages/auth/src/profile.ts:20</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Look up a user profile by blockstack ID</p>
</div>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>options: <a href="../interfaces/auth.profilelookupoptions.html" class="tsd-signature-type" data-tsd-kind="Interface">ProfileLookupOptions</a></h5>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">Record</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">&gt;</span><span class="tsd-signature-symbol">&gt;</span></h4>
<p>that resolves to a profile object</p>
</li>
</ul>
</section>
<section class="tsd-panel tsd-member tsd-kind-function tsd-parent-kind-module">
<a name="makeauthrequest" class="tsd-anchor"></a>
<h3>make<wbr>Auth<wbr>Request</h3>
<ul class="tsd-signatures tsd-kind-function tsd-parent-kind-module">
<li class="tsd-signature tsd-kind-icon">make<wbr>Auth<wbr>Request<span class="tsd-signature-symbol">(</span>transitPrivateKey<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, redirectURI<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, manifestURI<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, scopes<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-symbol">(</span><a href="../enums/auth.authscope.html" class="tsd-signature-type" data-tsd-kind="Enumeration">AuthScope</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span>, appDomain<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, expiresAt<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, extraParams<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">any</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span></li>
</ul>
<ul class="tsd-descriptions">
<li class="tsd-description">
<aside class="tsd-sources">
<ul>
<li>Defined in <a href="https://github.com/blockstack/stacks.js/blob/master/packages/auth/src/messages.ts#L56">packages/auth/src/messages.ts:56</a></li>
</ul>
</aside>
<div class="tsd-comment tsd-typography">
<div class="lead">
<p>Generates an authentication request that can be sent to the Blockstack
browser for the user to approve sign in. This authentication request can
then be used for sign in by passing it to the <code>redirectToSignInWithAuthRequest</code>
method.</p>
</div>
<p><em>Note: This method should only be used if you want to roll your own authentication
flow. Typically you&#39;d use <code>redirectToSignIn</code> which takes care of this
under the hood.</em></p>
</div>
<h4 class="tsd-parameters-title">Parameters</h4>
<ul class="tsd-parameters">
<li>
<h5>transitPrivateKey: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>hex encoded transit private key</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> redirectURI: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>location to redirect user to after sign in approval</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> manifestURI: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>location of this app&#39;s manifest file</p>
</div>
</li>
<li>
<h5>scopes: <span class="tsd-signature-symbol">(</span><a href="../enums/auth.authscope.html" class="tsd-signature-type" data-tsd-kind="Enumeration">AuthScope</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> = ...</span></h5>
<div class="tsd-comment tsd-typography">
<p>the permissions this app is requesting</p>
</div>
</li>
<li>
<h5><span class="tsd-flag ts-flagOptional">Optional</span> appDomain: <span class="tsd-signature-type">string</span></h5>
<div class="tsd-comment tsd-typography">
<p>the origin of this app</p>
</div>
</li>
<li>
<h5>expiresAt: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = ...</span></h5>
<div class="tsd-comment tsd-typography">
<p>the time at which this request is no longer valid</p>
</div>
</li>
<li>
<h5>extraParams: <span class="tsd-signature-type">any</span><span class="tsd-signature-symbol"> = {}</span></h5>
<div class="tsd-comment tsd-typography">
<p>Any extra parameters you&#39;d like to pass to the authenticator.
Use this to pass options that aren&#39;t part of the Blockstack auth spec, but might be supported
by special authenticators.</p>
</div>
</li>
</ul>
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">string</span></h4>
<p>the authentication request</p>
</li>
</ul>
</section>
</section>
</div>
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
<nav class="tsd-navigation primary">
<ul>
<li class=" ">
<a href="../modules.html">Modules</a>
</li>
<li class="current tsd-kind-module">
<a href="auth.html">auth</a>
</li>
<li class=" tsd-kind-module">
<a href="bns.html">bns</a>
</li>
<li class=" tsd-kind-module">
<a href="cli.html">cli</a>
</li>
<li class=" tsd-kind-module">
<a href="common.html">common</a>
</li>
<li class=" tsd-kind-module">
<a href="encryption.html">encryption</a>
</li>
<li class=" tsd-kind-module">
<a href="keychain.html">keychain</a>
</li>
<li class=" tsd-kind-module">
<a href="network.html">network</a>
</li>
<li class=" tsd-kind-module">
<a href="profile.html">profile</a>
</li>
<li class=" tsd-kind-module">
<a href="stacking.html">stacking</a>
</li>
<li class=" tsd-kind-module">
<a href="storage.html">storage</a>
</li>
<li class=" tsd-kind-module">
<a href="transactions.html">transactions</a>
</li>
</ul>
</nav>
<nav class="tsd-navigation secondary menu-sticky">
<ul class="before-current">
</ul>
<ul class="current">
<li class="current tsd-kind-module">
<a href="auth.html" class="tsd-kind-icon">auth</a>
<ul>
<li class=" tsd-kind-enum tsd-parent-kind-module">
<a href="../enums/auth.authscope.html" class="tsd-kind-icon">Auth<wbr>Scope</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-module">
<a href="../classes/auth.appconfig.html" class="tsd-kind-icon">App<wbr>Config</a>
</li>
<li class=" tsd-kind-class tsd-parent-kind-module">
<a href="../classes/auth.usersession.html" class="tsd-kind-icon">User<wbr>Session</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-module">
<a href="../interfaces/auth.profilelookupoptions.html" class="tsd-kind-icon">Profile<wbr>Lookup<wbr>Options</a>
</li>
<li class=" tsd-kind-interface tsd-parent-kind-module">
<a href="../interfaces/auth.userdata.html" class="tsd-kind-icon">User<wbr>Data</a>
</li>
<li class=" tsd-kind-variable tsd-parent-kind-module">
<a href="auth.html#default_blockstack_host" class="tsd-kind-icon">DEFAULT_<wbr>BLOCKSTACK_<wbr>HOST</a>
</li>
<li class=" tsd-kind-variable tsd-parent-kind-module">
<a href="auth.html#default_profile" class="tsd-kind-icon">DEFAULT_<wbr>PROFILE</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="auth.html#lookupprofile" class="tsd-kind-icon">lookup<wbr>Profile</a>
</li>
<li class=" tsd-kind-function tsd-parent-kind-module">
<a href="auth.html#makeauthrequest" class="tsd-kind-icon">make<wbr>Auth<wbr>Request</a>
</li>
</ul>
</li>
</ul>
<ul class="after-current">
<li class=" tsd-kind-module">
<a href="bns.html" class="tsd-kind-icon">bns</a>
</li>
<li class=" tsd-kind-module">
<a href="cli.html" class="tsd-kind-icon">cli</a>
</li>
<li class=" tsd-kind-module">
<a href="common.html" class="tsd-kind-icon">common</a>
</li>
<li class=" tsd-kind-module">
<a href="encryption.html" class="tsd-kind-icon">encryption</a>
</li>
<li class=" tsd-kind-module">
<a href="keychain.html" class="tsd-kind-icon">keychain</a>
</li>
<li class=" tsd-kind-module">
<a href="network.html" class="tsd-kind-icon">network</a>
</li>
<li class=" tsd-kind-module">
<a href="profile.html" class="tsd-kind-icon">profile</a>
</li>
<li class=" tsd-kind-module">
<a href="stacking.html" class="tsd-kind-icon">stacking</a>
</li>
<li class=" tsd-kind-module">
<a href="storage.html" class="tsd-kind-icon">storage</a>
</li>
<li class=" tsd-kind-module">
<a href="transactions.html" class="tsd-kind-icon">transactions</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<footer class="with-border-bottom">
<div class="container">
<h2>Legend</h2>
<div class="tsd-legend-group">
<ul class="tsd-legend">
<li class="tsd-kind-variable"><span class="tsd-kind-icon">Variable</span></li>
<li class="tsd-kind-function"><span class="tsd-kind-icon">Function</span></li>
<li class="tsd-kind-function tsd-has-type-parameter"><span class="tsd-kind-icon">Function with type parameter</span></li>
<li class="tsd-kind-type-alias"><span class="tsd-kind-icon">Type alias</span></li>
<li class="tsd-kind-type-alias tsd-has-type-parameter"><span class="tsd-kind-icon">Type alias with type parameter</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-interface"><span class="tsd-kind-icon">Interface</span></li>
<li class="tsd-kind-interface tsd-has-type-parameter"><span class="tsd-kind-icon">Interface with type parameter</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-enum"><span class="tsd-kind-icon">Enumeration</span></li>
</ul>
<ul class="tsd-legend">
<li class="tsd-kind-class"><span class="tsd-kind-icon">Class</span></li>
</ul>
</div>
</div>
</footer>
<div class="container tsd-generator">
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p>
</div>
<div class="overlay"></div>
<script src="../assets/js/main.js"></script>
</body>
</html>