Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
andreaTP committed Oct 31, 2023
1 parent 7b4d6c4 commit 46fd0da
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;

/** Provides an implementation of the Basic Access Authentication scheme: https://en.wikipedia.org/wiki/Basic_access_authentication . */
Expand All @@ -24,6 +25,9 @@ public class BasicAccessAuthenticationProvider implements AuthenticationProvider
* @param password the password to be used.
*/
public BasicAccessAuthenticationProvider(@Nonnull final String username, @Nonnull final String password) {
Objects.requireNonNull(username);
Objects.requireNonNull(password);

this.username = username;
this.password = password;
encoded = Base64.getEncoder().encodeToString((username + ":" + password).getBytes(StandardCharsets.UTF_8));
Expand Down

0 comments on commit 46fd0da

Please sign in to comment.