<titledata-rh="true">Interface: AuthenticationProvider | Podman Desktop</title><metadata-rh="true"name="viewport"content="width=device-width,initial-scale=1"><metadata-rh="true"name="twitter:card"content="summary_large_image"><metadata-rh="true"property="og:image"content="https://podman-desktop.io/img/banner_podman-desktop.png"><metadata-rh="true"name="twitter:image"content="https://podman-desktop.io/img/banner_podman-desktop.png"><metadata-rh="true"property="og:url"content="https://podman-desktop.io/api/interfaces/AuthenticationProvider"><metadata-rh="true"property="og:locale"content="en"><metadata-rh="true"name="docusaurus_locale"content="en"><metadata-rh="true"name="docsearch:language"content="en"><metadata-rh="true"name="docusaurus_version"content="current"><metadata-rh="true"name="docusaurus_tag"content="docs-api-current"><metadata-rh="true"name="docsearch:version"content="current"><metadata-rh="true"name="docsearch:docusaurus_tag"content="docs-api-current"><metadata-rh="true"property="og:title"content="Interface: AuthenticationProvider | Podman Desktop"><metadata-rh="true"name="description"content="A provider for performing authentication to a service."><metadata-rh="true"property="og:description"content="A provider for performing authentication to a service."><linkdata-rh="true"rel="icon"href="/img/favicon.ico"><linkdata-rh="true"rel="canonical"href="https://podman-desktop.io/api/interfaces/AuthenticationProvider"><linkdata-rh="true"rel="alternate"href="https://podman-desktop.io/api/interfaces/AuthenticationProvider"hreflang="en"><linkdata-rh="true"rel="alternate"href="https://podman-desktop.io/api/interfaces/AuthenticationProvider"hreflang="x-default"><linkdata-rh="true"rel="preconnect"href="https://MR01ANKQ9S-dsn.algolia.net"crossorigin="anonymous"><linkrel="alternate"type="application/rss+xml"href="/blog/rss.xml"title="Podman Desktop RSS Feed">
<linkrel="alternate"type="application/atom+xml"href="/blog/atom.xml"title="Podman Desktop Atom Feed">
<p>A provider for performing authentication to a service.</p>
<h2class="anchor anchorWithStickyNavbar_JmGV"id="properties">Properties<ahref="#properties"class="hash-link"aria-label="Direct link to Properties"title="Direct link to Properties"></a></h2>
<h3class="anchor anchorWithStickyNavbar_JmGV"id="ondidchangesessions">onDidChangeSessions<ahref="#ondidchangesessions"class="hash-link"aria-label="Direct link to onDidChangeSessions"title="Direct link to onDidChangeSessions"></a></h3>
<p>An <ahref="#Event">event</a> which fires when the array of sessions has changed, or data
within a session has changed.</p>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="source">Source<ahref="#source"class="hash-link"aria-label="Direct link to Source"title="Direct link to Source"></a></h4>
<h2class="anchor anchorWithStickyNavbar_JmGV"id="methods">Methods<ahref="#methods"class="hash-link"aria-label="Direct link to Methods"title="Direct link to Methods"></a></h2>
<h3class="anchor anchorWithStickyNavbar_JmGV"id="createsession">createSession()<ahref="#createsession"class="hash-link"aria-label="Direct link to createSession()"title="Direct link to createSession()"></a></h3>
<p>If login is successful, the onDidChangeSessions event should be fired.</p>
<p>If login fails, a rejected promise should be returned.</p>
<p>If the provider has specified that it does not support multiple accounts,
then this should never be called if there is already an existing session matching these
scopes.</p>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="parameters">Parameters<ahref="#parameters"class="hash-link"aria-label="Direct link to Parameters"title="Direct link to Parameters"></a></h4>
<p>A list of scopes, permissions, that the new session should be created with.</p>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="returns">Returns<ahref="#returns"class="hash-link"aria-label="Direct link to Returns"title="Direct link to Returns"></a></h4>
<p>A promise that resolves to an authentication session.</p>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="source-1">Source<ahref="#source-1"class="hash-link"aria-label="Direct link to Source"title="Direct link to Source"></a></h4>
<h3class="anchor anchorWithStickyNavbar_JmGV"id="getsessions">getSessions()<ahref="#getsessions"class="hash-link"aria-label="Direct link to getSessions()"title="Direct link to getSessions()"></a></h3>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="parameters-1">Parameters<ahref="#parameters-1"class="hash-link"aria-label="Direct link to Parameters"title="Direct link to Parameters"></a></h4>
<p>An optional list of scopes. If provided, the sessions returned should match
these permissions, otherwise all sessions should be returned.</p>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="returns-1">Returns<ahref="#returns-1"class="hash-link"aria-label="Direct link to Returns"title="Direct link to Returns"></a></h4>
<p>A promise that resolves to an array of authentication sessions.</p>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="source-2">Source<ahref="#source-2"class="hash-link"aria-label="Direct link to Source"title="Direct link to Source"></a></h4>
<h3class="anchor anchorWithStickyNavbar_JmGV"id="removesession">removeSession()<ahref="#removesession"class="hash-link"aria-label="Direct link to removeSession()"title="Direct link to removeSession()"></a></h3>
<p>Removes the session corresponding to session id.</p>
<p>If the removal is successful, the onDidChangeSessions event should be fired.</p>
<p>If a session cannot be removed, the provider should reject with an error message.</p>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="parameters-2">Parameters<ahref="#parameters-2"class="hash-link"aria-label="Direct link to Parameters"title="Direct link to Parameters"></a></h4>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="returns-2">Returns<ahref="#returns-2"class="hash-link"aria-label="Direct link to Returns"title="Direct link to Returns"></a></h4>
<h4class="anchor anchorWithStickyNavbar_JmGV"id="source-3">Source<ahref="#source-3"class="hash-link"aria-label="Direct link to Source"title="Direct link to Source"></a></h4>