File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
openid/src/main/java/com/inrupt/client/openid Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 2727import com .inrupt .client .auth .Session ;
2828import com .inrupt .client .spi .AuthenticationProvider ;
2929
30- import java .util .Optional ;
3130import java .util .Set ;
3231import java .util .TreeSet ;
3332import 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}
You can’t perform that action at this time.
0 commit comments