jenkins.authentication.tokens.api.AuthenticationTokenException Java Examples

The following examples show how to use jenkins.authentication.tokens.api.AuthenticationTokenException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DockerRegistryAuthTokenSource.java    From yet-another-docker-plugin with MIT License 5 votes vote down vote up
@Nonnull
@Override
public DockerRegistryToken convert(@Nonnull DockerRegistryAuthCredentials c) throws AuthenticationTokenException {
    return new DockerRegistryToken(c.getEmail(),
            Base64.encodeBase64String((c.getUsername() + ":" + c.getPassword().getPlainText())
                    .getBytes(Charsets.UTF_8)));
}
 
Example #2
Source File: UsernamePasswordDockerRegistryTokenSource.java    From docker-commons-plugin with MIT License 5 votes vote down vote up
@NonNull
@Override
public DockerRegistryToken convert(UsernamePasswordCredentials c) throws AuthenticationTokenException {
    return new DockerRegistryToken(c.getUsername(),
            Base64.encodeBase64String((c.getUsername() + ":" + c.getPassword().getPlainText())
                    .getBytes(Charsets.UTF_8)));
}
 
Example #3
Source File: GiteaAuthTokenSource.java    From gitea-plugin with MIT License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@NonNull
@Override
public GiteaAuthToken convert(@NonNull PersonalAccessToken credential) throws AuthenticationTokenException {
    return new GiteaAuthToken(credential.getToken().getPlainText());
}
 
Example #4
Source File: GiteaAuthUserSource.java    From gitea-plugin with MIT License 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@NonNull
@Override
public GiteaAuthUser convert(@NonNull UsernamePasswordCredentials credential) throws AuthenticationTokenException {
    return new GiteaAuthUser(credential.getUsername(), credential.getPassword().getPlainText());
}
 
Example #5
Source File: ServerKeyMaterialFactoryFromDockerCredentials.java    From docker-commons-plugin with MIT License 4 votes vote down vote up
@NonNull
@Override
public KeyMaterialFactory convert(@NonNull DockerServerCredentials credential) throws AuthenticationTokenException {
    return new ServerKeyMaterialFactory(Secret.toString(credential.getClientKeySecret()), credential.getClientCertificate(), credential.getServerCaCertificate());
}