FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

JCL-366: Remove use of deprecated authenticate by acoburn · Pull Request #489 · inrupt/solid-client-java · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import com.inrupt.client.auth.Session;
import com.inrupt.client.spi.AuthenticationProvider;

import java.util.Optional;
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -111,13 +110,8 @@ public int getPriority() {
@Override
public CompletionStage<Credential> authenticate(final Session session, final Request request,
final Set<String> algorithms) {
final Optional<CompletionStage<Credential>> token = session
.getCredential(OpenIdSession.ID_TOKEN, request.uri())
.map(CompletableFuture::completedFuture);
return token
.orElseGet(() -> session.authenticate(request, algorithms)
.thenApply(credential -> credential
.orElseThrow(() -> new OpenIdException("Unable to perform OpenID authentication"))));
return CompletableFuture.completedFuture(session
.getCredential(OpenIdSession.ID_TOKEN, request.uri()).orElse(null));
}
}
}
Expand Down

Back | FazBrowse Home | New Git URL