Skip to content

Commit f17fa56

Browse files
authored
JCL-366: Remove use of deprecated authenticate (#489)
1 parent ebd3626 commit f17fa56

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

openid/src/main/java/com/inrupt/client/openid/OpenIdAuthenticationProvider.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import com.inrupt.client.auth.Session;
2828
import com.inrupt.client.spi.AuthenticationProvider;
2929

30-
import java.util.Optional;
3130
import java.util.Set;
3231
import java.util.TreeSet;
3332
import java.util.concurrent.CompletableFuture;
@@ -111,13 +110,8 @@ public int getPriority() {
111110
@Override
112111
public CompletionStage<Credential> authenticate(final Session session, final Request request,
113112
final Set<String> algorithms) {
114-
final Optional<CompletionStage<Credential>> token = session
115-
.getCredential(OpenIdSession.ID_TOKEN, request.uri())
116-
.map(CompletableFuture::completedFuture);
117-
return token
118-
.orElseGet(() -> session.authenticate(request, algorithms)
119-
.thenApply(credential -> credential
120-
.orElseThrow(() -> new OpenIdException("Unable to perform OpenID authentication"))));
113+
return CompletableFuture.completedFuture(session
114+
.getCredential(OpenIdSession.ID_TOKEN, request.uri()).orElse(null));
121115
}
122116
}
123117
}

0 commit comments

Comments
 (0)