blob: bbae0ed777267bece99362a5dc831f55bb85266b [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>JwtAuthenticator (Apache Archiva Redback 3.0.0-SNAPSHOT API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../../jquery/jquery-3.5.1.js"></script>
<script type="text/javascript" src="../../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="JwtAuthenticator (Apache Archiva Redback 3.0.0-SNAPSHOT API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/JwtAuthenticator.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.archiva.redback.authentication.jwt</a></div>
<h2 title="Class JwtAuthenticator" class="title">Class JwtAuthenticator</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li><a href="../AbstractAuthenticator.html" title="class in org.apache.archiva.redback.authentication">org.apache.archiva.redback.authentication.AbstractAuthenticator</a></li>
<li>
<ul class="inheritance">
<li>org.apache.archiva.redback.authentication.jwt.JwtAuthenticator</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="../Authenticator.html" title="interface in org.apache.archiva.redback.authentication">Authenticator</a></code></dd>
</dl>
<hr>
<pre>@Service("authenticator#jwt")
public class <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.143">JwtAuthenticator</a>
extends <a href="../AbstractAuthenticator.html" title="class in org.apache.archiva.redback.authentication">AbstractAuthenticator</a>
implements <a href="../Authenticator.html" title="interface in org.apache.archiva.redback.authentication">Authenticator</a></pre>
<div class="block">Authenticator for JWT tokens. This authenticator needs a secret key or keypair depending
on the used algorithm for signing and verification.
The key can be either volatile in memory, which means a new one is created, with each
start of the service. Or it can be stored in a file.
If this service is running in a cluster, you need a shared filesystem (NFS) for storing
the key file otherwise different keys will be used in each instance.
<p>
You can renew the used key (<a href="#renewSigningKey()"><code>renewSigningKey()</code></a>). The authenticator keeps a fixed
sized list of the last keys used and stores the key identifier in the JWT header.
<p>
The default algorithm used for the JWT is currently <a href="../../configuration/UserConfigurationKeys.html#AUTHENTICATION_JWT_SIGALG_ES384"><code>UserConfigurationKeys.AUTHENTICATION_JWT_SIGALG_ES384</code></a>
If the <code>plainfile</code> keystore is used, only the most recent key is saved to the file. Not the
complete list.
The JWT tokens have a lifetime set (14400 seconds - 4 hours).
The following configuration keys are used to setup this authenticator:
<dl>
<dt><a href="../../configuration/UserConfigurationKeys.html#AUTHENTICATION_JWT_KEYSTORETYPE">"authentication.jwt.keystoreType"</a></dt>
<dd>The type of the keystore, either <code><a href="../../configuration/UserConfigurationKeys.html#AUTHENTICATION_JWT_KEYSTORETYPE_MEMORY">"memory"</a></code>
(key is lost, if the jvm stops) or <code><a href="../../configuration/UserConfigurationKeys.html#AUTHENTICATION_JWT_KEYSTORETYPE_PLAINFILE">"plainfile"</a></code></dd>
<dt><a href="../../configuration/UserConfigurationKeys.html#AUTHENTICATION_JWT_SIGALG">"authentication.jwt.signatureAlgorithm"</a></dt>
<dd>The signature algorithm for the JWT.
<ul>
<li>HS256: HMAC using SHA-256</li>
<li>HS384: HMAC using SHA-384</li>
<li>HS512: HMAC using SHA-512</li>
<li>ES256: ECDSA using P-256 and SHA-256</li>
<li>ES384: ECDSA using P-384 and SHA-384</li>
<li>ES512: ECDSA using P-521 and SHA-512</li>
<li>RS256: RSASSA-PKCS-v1_5 using SHA-256</li>
<li>RS384: RSASSA-PKCS-v1_5 using SHA-384</li>
<li>RS512: RSASSA-PKCS-v1_5 using SHA-512</li>
<li>PS256: RSASSA-PSS using SHA-256 and MGF1 with SHA-256</li>
<li>PS384: RSASSA-PSS using SHA-384 and MGF1 with SHA-384</li>
<li>PS512: RSASSA-PSS using SHA-512 and MGF1 with SHA-512</li>
</ul>
</dd>
<dt><a href="../../configuration/UserConfigurationKeys.html#AUTHENTICATION_JWT_MAX_KEYS">"authentication.jwt.maxInMemoryKeys"</a></dt>
<dd>The maximum number of signature keys to keep in memory for verification</dd>
<dt><a href="../../configuration/UserConfigurationKeys.html#AUTHENTICATION_JWT_KEYFILE">"authentication.jwt.keyfile"</a></dt>
<dd>The key file. Either a full path to the file, or a single filename, which means it is stored in the working directory</dd>
<dt><a href="../../configuration/UserConfigurationKeys.html#AUTHENTICATION_JWT_LIFETIME_MS">"authentication.jwt.lifetimeMs"</a></dt>
<dd>The default token lifetime in milliseconds</dd>
</dl></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="JwtAuthenticator.SigningKeyResolver.html" title="class in org.apache.archiva.redback.authentication.jwt">JwtAuthenticator.SigningKeyResolver</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DEFAULT_KEYFILE">DEFAULT_KEYFILE</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DEFAULT_LIFETIME">DEFAULT_LIFETIME</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#DEFAULT_REFRESH_LIFETIME">DEFAULT_REFRESH_LIFETIME</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#ID">ID</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PROP_KEYID">PROP_KEYID</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PROP_PRIV_ALG">PROP_PRIV_ALG</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PROP_PRIV_FORMAT">PROP_PRIV_FORMAT</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PROP_PRIVATEKEY">PROP_PRIVATEKEY</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PROP_PUB_ALG">PROP_PUB_ALG</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PROP_PUB_FORMAT">PROP_PUB_FORMAT</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#PROP_PUBLICKEY">PROP_PUBLICKEY</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="fields.inherited.from.class.org.apache.archiva.redback.authentication.AbstractAuthenticator">
<!-- -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.archiva.redback.authentication.<a href="../AbstractAuthenticator.html" title="class in org.apache.archiva.redback.authentication">AbstractAuthenticator</a></h3>
<code><a href="../AbstractAuthenticator.html#valid">valid</a></code></li>
</ul>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E()">JwtAuthenticator</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="../AuthenticationResult.html" title="class in org.apache.archiva.redback.authentication">AuthenticationResult</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#authenticate(org.apache.archiva.redback.authentication.AuthenticationDataSource)">authenticate</a></span>&#8203;(<a href="../AuthenticationDataSource.html" title="interface in org.apache.archiva.redback.authentication">AuthenticationDataSource</a>&nbsp;dataSource)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../AuthenticationResult.html" title="class in org.apache.archiva.redback.authentication">AuthenticationResult</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#authenticate(org.apache.archiva.redback.authentication.BearerTokenAuthenticationDataSource)">authenticate</a></span>&#8203;(<a href="../BearerTokenAuthenticationDataSource.html" title="class in org.apache.archiva.redback.authentication">BearerTokenAuthenticationDataSource</a>&nbsp;source)</code></th>
<td class="colLast">
<div class="block">Tries to verify the represented token and returns the result</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="../Token.html" title="interface in org.apache.archiva.redback.authentication">Token</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#generateToken(java.lang.String)">generateToken</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;userId)</code></th>
<td class="colLast">
<div class="block">Creates a token for the given user id.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../Token.html" title="interface in org.apache.archiva.redback.authentication">Token</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#generateToken(java.lang.String,org.apache.archiva.redback.authentication.TokenType)">generateToken</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;userId,
<a href="../TokenType.html" title="enum in org.apache.archiva.redback.authentication">TokenType</a>&nbsp;type)</code></th>
<td class="colLast">
<div class="block">Creates a token for the given user id.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCurrentKeyId()">getCurrentKeyId</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the current used key identifier.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getCurrentKeyListSize()">getCurrentKeyListSize</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the current size of the in memory key list</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getId()">getId</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink">Path</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getKeystoreFilePath()">getKeystoreFilePath</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the path to the keystore file or <code>null</code>, if the keystore type is <code>memory</code></div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getKeystoreType()">getKeystoreType</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the keystore type that is setup for the authenticator</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getMaxInMemoryKeys()">getMaxInMemoryKeys</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the maximum number of signature keys to store in memory for verification</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSignatureAlgorithm()">getSignatureAlgorithm</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the signature algorithm used for signing JWT tokens</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time" class="externalLink">Duration</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getTokenLifetime()">getTokenLifetime</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the default token lifetime of generated tokens.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="../../configuration/UserConfiguration.html" title="interface in org.apache.archiva.redback.configuration">UserConfiguration</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getUserConfiguration()">getUserConfiguration</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#init()">init</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>io.jsonwebtoken.Jws&lt;io.jsonwebtoken.Claims&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#parseToken(java.lang.String)">parseToken</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token)</code></th>
<td class="colLast">
<div class="block">Parses the given token and returns the JWS metadata stored in the token.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="../Token.html" title="interface in org.apache.archiva.redback.authentication">Token</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#refreshAccessToken(java.lang.String)">refreshAccessToken</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;refreshToken)</code></th>
<td class="colLast">
<div class="block">Allows to renew a token based on the origin token.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#renewSigningKey()">renewSigningKey</a></span>()</code></th>
<td class="colLast">
<div class="block">Creates a new signing key and uses this for new tokens.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#revokeSigningKeys()">revokeSigningKeys</a></span>()</code></th>
<td class="colLast">
<div class="block">Removes all signing keys and creates a new one.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setTokenLifetime(java.time.Duration)">setTokenLifetime</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time" class="externalLink">Duration</a>&nbsp;lifetime)</code></th>
<td class="colLast">
<div class="block">Sets the default token lifetime of generated tokens.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#setUserConfiguration(org.apache.archiva.redback.configuration.UserConfiguration)">setUserConfiguration</a></span>&#8203;(<a href="../../configuration/UserConfiguration.html" title="interface in org.apache.archiva.redback.configuration">UserConfiguration</a>&nbsp;userConfiguration)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#supportsDataSource(org.apache.archiva.redback.authentication.AuthenticationDataSource)">supportsDataSource</a></span>&#8203;(<a href="../AuthenticationDataSource.html" title="interface in org.apache.archiva.redback.authentication">AuthenticationDataSource</a>&nbsp;source)</code></th>
<td class="colLast">
<div class="block">Returns <code>true</code>, if the source is a instance of <a href="../TokenBasedAuthenticationDataSource.html" title="class in org.apache.archiva.redback.authentication"><code>TokenBasedAuthenticationDataSource</code></a></div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code><a href="../Token.html" title="interface in org.apache.archiva.redback.authentication">Token</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#tokenFromString(java.lang.String)">tokenFromString</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;tokenData)</code></th>
<td class="colLast">
<div class="block">Returns a token object from the given token String</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#usesSymmetricAlgorithm()">usesSymmetricAlgorithm</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns <code>true</code>, if the signature algorithm ist a symmetric one, otherwise <code>false</code></div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#verify(java.lang.String)">verify</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token)</code></th>
<td class="colLast">
<div class="block">Verifies the given JWT Token and returns the stored subject, if successful
If the verification failed a TokenAuthenticationException is thrown.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#verify(java.lang.String,org.apache.archiva.redback.authentication.TokenType)">verify</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token,
<a href="../TokenType.html" title="enum in org.apache.archiva.redback.authentication">TokenType</a>&nbsp;type)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.org.apache.archiva.redback.authentication.AbstractAuthenticator">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.archiva.redback.authentication.<a href="../AbstractAuthenticator.html" title="class in org.apache.archiva.redback.authentication">AbstractAuthenticator</a></h3>
<code><a href="../AbstractAuthenticator.html#initialize()">initialize</a>, <a href="../AbstractAuthenticator.html#isValid()">isValid</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang" class="externalLink">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang" class="externalLink">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait(long,int)" title="class or interface in java.lang" class="externalLink">wait</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.org.apache.archiva.redback.authentication.Authenticator">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;org.apache.archiva.redback.authentication.<a href="../Authenticator.html" title="interface in org.apache.archiva.redback.authentication">Authenticator</a></h3>
<code><a href="../Authenticator.html#initialize()">initialize</a>, <a href="../Authenticator.html#isValid()">isValid</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="DEFAULT_LIFETIME">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT_LIFETIME</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.149">DEFAULT_LIFETIME</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.DEFAULT_LIFETIME">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="DEFAULT_REFRESH_LIFETIME">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT_REFRESH_LIFETIME</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.151">DEFAULT_REFRESH_LIFETIME</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.DEFAULT_REFRESH_LIFETIME">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="DEFAULT_KEYFILE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DEFAULT_KEYFILE</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.152">DEFAULT_KEYFILE</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.DEFAULT_KEYFILE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="ID">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ID</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.153">ID</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.ID">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="PROP_PRIV_ALG">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PROP_PRIV_ALG</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.154">PROP_PRIV_ALG</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.PROP_PRIV_ALG">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="PROP_PRIV_FORMAT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PROP_PRIV_FORMAT</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.155">PROP_PRIV_FORMAT</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.PROP_PRIV_FORMAT">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="PROP_PUB_ALG">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PROP_PUB_ALG</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.156">PROP_PUB_ALG</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.PROP_PUB_ALG">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="PROP_PUB_FORMAT">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PROP_PUB_FORMAT</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.157">PROP_PUB_FORMAT</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.PROP_PUB_FORMAT">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="PROP_PRIVATEKEY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PROP_PRIVATEKEY</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.158">PROP_PRIVATEKEY</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.PROP_PRIVATEKEY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="PROP_PUBLICKEY">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>PROP_PUBLICKEY</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.159">PROP_PUBLICKEY</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.PROP_PUBLICKEY">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="PROP_KEYID">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>PROP_KEYID</h4>
<pre>public static final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a> <a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.160">PROP_KEYID</a></pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../../constant-values.html#org.apache.archiva.redback.authentication.jwt.JwtAuthenticator.PROP_KEYID">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>JwtAuthenticator</h4>
<pre>public&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.144">JwtAuthenticator</a>()</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getId</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.213">getId</a>()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../Authenticator.html#getId()">getId</a></code>&nbsp;in interface&nbsp;<code><a href="../Authenticator.html" title="interface in org.apache.archiva.redback.authentication">Authenticator</a></code></dd>
</dl>
</li>
</ul>
<a id="init()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>init</h4>
<pre class="methodSignature"><a href="https://docs.oracle.com/javase/8/docs/api/javax/annotation/PostConstruct.html?is-external=true" title="class or interface in javax.annotation" class="externalLink">@PostConstruct</a>
public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.219">init</a>()
throws <a href="../AuthenticationException.html" title="class in org.apache.archiva.redback.authentication">AuthenticationException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../AuthenticationException.html" title="class in org.apache.archiva.redback.authentication">AuthenticationException</a></code></dd>
</dl>
</li>
</ul>
<a id="supportsDataSource(org.apache.archiva.redback.authentication.AuthenticationDataSource)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>supportsDataSource</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.556">supportsDataSource</a>&#8203;(<a href="../AuthenticationDataSource.html" title="interface in org.apache.archiva.redback.authentication">AuthenticationDataSource</a>&nbsp;source)</pre>
<div class="block">Returns <code>true</code>, if the source is a instance of <a href="../TokenBasedAuthenticationDataSource.html" title="class in org.apache.archiva.redback.authentication"><code>TokenBasedAuthenticationDataSource</code></a></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../Authenticator.html#supportsDataSource(org.apache.archiva.redback.authentication.AuthenticationDataSource)">supportsDataSource</a></code>&nbsp;in interface&nbsp;<code><a href="../Authenticator.html" title="interface in org.apache.archiva.redback.authentication">Authenticator</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - the source to check</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code>, if the given source is a instance of <a href="../TokenBasedAuthenticationDataSource.html" title="class in org.apache.archiva.redback.authentication"><code>TokenBasedAuthenticationDataSource</code></a></dd>
</dl>
</li>
</ul>
<a id="authenticate(org.apache.archiva.redback.authentication.BearerTokenAuthenticationDataSource)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>authenticate</h4>
<pre class="methodSignature">public&nbsp;<a href="../AuthenticationResult.html" title="class in org.apache.archiva.redback.authentication">AuthenticationResult</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.568">authenticate</a>&#8203;(<a href="../BearerTokenAuthenticationDataSource.html" title="class in org.apache.archiva.redback.authentication">BearerTokenAuthenticationDataSource</a>&nbsp;source)
throws <a href="../AuthenticationException.html" title="class in org.apache.archiva.redback.authentication">AuthenticationException</a></pre>
<div class="block">Tries to verify the represented token and returns the result</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - the authentication source, which must be a <a href="../TokenBasedAuthenticationDataSource.html" title="class in org.apache.archiva.redback.authentication"><code>TokenBasedAuthenticationDataSource</code></a></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the authentication result</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../AuthenticationException.html" title="class in org.apache.archiva.redback.authentication">AuthenticationException</a></code> - if the source is no <a href="../TokenBasedAuthenticationDataSource.html" title="class in org.apache.archiva.redback.authentication"><code>TokenBasedAuthenticationDataSource</code></a></dd>
</dl>
</li>
</ul>
<a id="authenticate(org.apache.archiva.redback.authentication.AuthenticationDataSource)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>authenticate</h4>
<pre class="methodSignature">public&nbsp;<a href="../AuthenticationResult.html" title="class in org.apache.archiva.redback.authentication">AuthenticationResult</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.583">authenticate</a>&#8203;(<a href="../AuthenticationDataSource.html" title="interface in org.apache.archiva.redback.authentication">AuthenticationDataSource</a>&nbsp;dataSource)
throws <a href="../AuthenticationException.html" title="class in org.apache.archiva.redback.authentication">AuthenticationException</a></pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../Authenticator.html#authenticate(org.apache.archiva.redback.authentication.AuthenticationDataSource)">authenticate</a></code>&nbsp;in interface&nbsp;<code><a href="../Authenticator.html" title="interface in org.apache.archiva.redback.authentication">Authenticator</a></code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../AuthenticationException.html" title="class in org.apache.archiva.redback.authentication">AuthenticationException</a></code></dd>
</dl>
</li>
</ul>
<a id="renewSigningKey()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>renewSigningKey</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.596">renewSigningKey</a>()</pre>
<div class="block">Creates a new signing key and uses this for new tokens. It will keep <a href="#maxInMemoryKeys"><code>maxInMemoryKeys</code></a> keys in the
list for jwt verification.</div>
</li>
</ul>
<a id="generateToken(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>generateToken</h4>
<pre class="methodSignature">public&nbsp;<a href="../Token.html" title="interface in org.apache.archiva.redback.authentication">Token</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.686">generateToken</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;userId)</pre>
<div class="block">Creates a token for the given user id. The token contains the following data:
<ul>
<li>the userid as subject</li>
<li>a issuer archiva.apache.org/redback</li>
<li>a id header with the key id</li>
</ul>the user id as subject.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>userId</code> - the user identifier to set as subject</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the token string</dd>
</dl>
</li>
</ul>
<a id="generateToken(java.lang.String,org.apache.archiva.redback.authentication.TokenType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>generateToken</h4>
<pre class="methodSignature">public&nbsp;<a href="../Token.html" title="interface in org.apache.archiva.redback.authentication">Token</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.715">generateToken</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;userId,
<a href="../TokenType.html" title="enum in org.apache.archiva.redback.authentication">TokenType</a>&nbsp;type)</pre>
<div class="block">Creates a token for the given user id. The token contains the following data:
<ul>
<li>the userid as subject</li>
<li>a issuer archiva.apache.org/redback</li>
<li>a id header with the key id</li>
</ul>the user id as subject.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>userId</code> - the user identifier to set as subject</dd>
<dd><code>type</code> - the token type that indicates if this token is a access or refresh token</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the token string</dd>
</dl>
</li>
</ul>
<a id="tokenFromString(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>tokenFromString</h4>
<pre class="methodSignature">public&nbsp;<a href="../Token.html" title="interface in org.apache.archiva.redback.authentication">Token</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.751">tokenFromString</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;tokenData)</pre>
<div class="block">Returns a token object from the given token String</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>tokenData</code> - the string representation of the token</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the token instance</dd>
</dl>
</li>
</ul>
<a id="refreshAccessToken(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>refreshAccessToken</h4>
<pre class="methodSignature">public&nbsp;<a href="../Token.html" title="interface in org.apache.archiva.redback.authentication">Token</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.771">refreshAccessToken</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;refreshToken)
throws <a href="TokenAuthenticationException.html" title="class in org.apache.archiva.redback.authentication.jwt">TokenAuthenticationException</a></pre>
<div class="block">Allows to renew a token based on the origin token. If the presented <code>origin</code>
is valid, a new token with refreshed expiration time will be returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>refreshToken</code> - the refresh token</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the newly created token</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../AuthenticationException.html" title="class in org.apache.archiva.redback.authentication">AuthenticationException</a></code> - if the given origin token is not valid</dd>
<dd><code><a href="TokenAuthenticationException.html" title="class in org.apache.archiva.redback.authentication.jwt">TokenAuthenticationException</a></code></dd>
</dl>
</li>
</ul>
<a id="parseToken(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>parseToken</h4>
<pre class="methodSignature">public&nbsp;io.jsonwebtoken.Jws&lt;io.jsonwebtoken.Claims&gt;&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.788">parseToken</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token)
throws io.jsonwebtoken.JwtException</pre>
<div class="block">Parses the given token and returns the JWS metadata stored in the token.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - the token string</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the parsed data</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>io.jsonwebtoken.JwtException</code> - if the token data is not valid anymore</dd>
</dl>
</li>
</ul>
<a id="verify(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>verify</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.799">verify</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token)
throws <a href="TokenAuthenticationException.html" title="class in org.apache.archiva.redback.authentication.jwt">TokenAuthenticationException</a></pre>
<div class="block">Verifies the given JWT Token and returns the stored subject, if successful
If the verification failed a TokenAuthenticationException is thrown.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>token</code> - the JWT representation</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the subject of the JWT</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TokenAuthenticationException.html" title="class in org.apache.archiva.redback.authentication.jwt">TokenAuthenticationException</a></code> - if the verification failed</dd>
</dl>
</li>
</ul>
<a id="verify(java.lang.String,org.apache.archiva.redback.authentication.TokenType)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>verify</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.804">verify</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;token,
<a href="../TokenType.html" title="enum in org.apache.archiva.redback.authentication">TokenType</a>&nbsp;type)
throws <a href="TokenAuthenticationException.html" title="class in org.apache.archiva.redback.authentication.jwt">TokenAuthenticationException</a></pre>
<dl>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="TokenAuthenticationException.html" title="class in org.apache.archiva.redback.authentication.jwt">TokenAuthenticationException</a></code></dd>
</dl>
</li>
</ul>
<a id="revokeSigningKeys()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>revokeSigningKeys</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.847">revokeSigningKeys</a>()</pre>
<div class="block">Removes all signing keys and creates a new one. If you call this method, all JWT tokens generated before,
will be invalid.</div>
</li>
</ul>
<a id="usesSymmetricAlgorithm()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>usesSymmetricAlgorithm</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.868">usesSymmetricAlgorithm</a>()</pre>
<div class="block">Returns <code>true</code>, if the signature algorithm ist a symmetric one, otherwise <code>false</code></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd><code>true</code>, if symmetric algorithm, otherwise <code>false</code></dd>
</dl>
</li>
</ul>
<a id="getSignatureAlgorithm()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSignatureAlgorithm</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.877">getSignatureAlgorithm</a>()</pre>
<div class="block">Returns the signature algorithm used for signing JWT tokens</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the string representation of the signature algorithm</dd>
</dl>
</li>
</ul>
<a id="getKeystoreType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKeystoreType</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang" class="externalLink">String</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.886">getKeystoreType</a>()</pre>
<div class="block">Returns the keystore type that is setup for the authenticator</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>either <code>memory</code> or <code>plainfile</code></dd>
</dl>
</li>
</ul>
<a id="getKeystoreFilePath()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getKeystoreFilePath</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html?is-external=true" title="class or interface in java.nio.file" class="externalLink">Path</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.895">getKeystoreFilePath</a>()</pre>
<div class="block">Returns the path to the keystore file or <code>null</code>, if the keystore type is <code>memory</code></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the path to the keystore file, or <code>null</code></dd>
</dl>
</li>
</ul>
<a id="getMaxInMemoryKeys()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxInMemoryKeys</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.904">getMaxInMemoryKeys</a>()</pre>
<div class="block">Returns the maximum number of signature keys to store in memory for verification</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the maximum number of signature keys to keep in memory</dd>
</dl>
</li>
</ul>
<a id="getCurrentKeyListSize()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCurrentKeyListSize</h4>
<pre class="methodSignature">public&nbsp;int&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.913">getCurrentKeyListSize</a>()</pre>
<div class="block">Returns the current size of the in memory key list</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the number of memory stored signature keys</dd>
</dl>
</li>
</ul>
<a id="getCurrentKeyId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCurrentKeyId</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.925">getCurrentKeyId</a>()</pre>
<div class="block">Returns the current used key identifier.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the key identifier</dd>
</dl>
</li>
</ul>
<a id="getTokenLifetime()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getTokenLifetime</h4>
<pre class="methodSignature">public&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time" class="externalLink">Duration</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.933">getTokenLifetime</a>()</pre>
<div class="block">Returns the default token lifetime of generated tokens.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the lifetime as duration</dd>
</dl>
</li>
</ul>
<a id="setTokenLifetime(java.time.Duration)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setTokenLifetime</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.941">setTokenLifetime</a>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/time/Duration.html?is-external=true" title="class or interface in java.time" class="externalLink">Duration</a>&nbsp;lifetime)</pre>
<div class="block">Sets the default token lifetime of generated tokens.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>lifetime</code> - the lifetime as duration</dd>
</dl>
</li>
</ul>
<a id="getUserConfiguration()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUserConfiguration</h4>
<pre class="methodSignature">public&nbsp;<a href="../../configuration/UserConfiguration.html" title="interface in org.apache.archiva.redback.configuration">UserConfiguration</a>&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.945">getUserConfiguration</a>()</pre>
</li>
</ul>
<a id="setUserConfiguration(org.apache.archiva.redback.configuration.UserConfiguration)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>setUserConfiguration</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;<a href="../../../../../../src-html/org/apache/archiva/redback/authentication/jwt/JwtAuthenticator.html#line.950">setUserConfiguration</a>&#8203;(<a href="../../configuration/UserConfiguration.html" title="interface in org.apache.archiva.redback.configuration">UserConfiguration</a>&nbsp;userConfiguration)</pre>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/JwtAuthenticator.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2006&#x2013;2022 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>