Refresh of credential may fail. If so, continue with old credential
This commit is contained in:
parent
2952fe6807
commit
34962fd631
@ -6,6 +6,7 @@ import static org.oneedtech.inspect.core.report.ReportUtil.onProbeException;
|
|||||||
import static org.oneedtech.inspect.util.code.Defensives.*;
|
import static org.oneedtech.inspect.util.code.Defensives.*;
|
||||||
import static org.oneedtech.inspect.util.json.ObjectMapperCache.Config.DEFAULT;
|
import static org.oneedtech.inspect.util.json.ObjectMapperCache.Config.DEFAULT;
|
||||||
import static org.oneedtech.inspect.vc.Credential.CREDENTIAL_KEY;
|
import static org.oneedtech.inspect.vc.Credential.CREDENTIAL_KEY;
|
||||||
|
import static org.oneedtech.inspect.vc.VerifiableCredential.REFRESH_SERVICE_MIME_TYPES;
|
||||||
import static org.oneedtech.inspect.vc.VerifiableCredential.ProofType.EXTERNAL;
|
import static org.oneedtech.inspect.vc.VerifiableCredential.ProofType.EXTERNAL;
|
||||||
import static org.oneedtech.inspect.vc.payload.PayloadParser.fromJwt;
|
import static org.oneedtech.inspect.vc.payload.PayloadParser.fromJwt;
|
||||||
import static org.oneedtech.inspect.vc.util.JsonNodeUtil.asNodeList;
|
import static org.oneedtech.inspect.vc.util.JsonNodeUtil.asNodeList;
|
||||||
@ -200,9 +201,11 @@ public class OB30Inspector extends VCInspector implements SubInspector {
|
|||||||
if(resource.getContext().get(REFRESHED) != TRUE) {
|
if(resource.getContext().get(REFRESHED) != TRUE) {
|
||||||
Optional<String> newID = checkRefreshService(ob, ctx);
|
Optional<String> newID = checkRefreshService(ob, ctx);
|
||||||
if(newID.isPresent()) {
|
if(newID.isPresent()) {
|
||||||
return this.run(
|
// If the refresh is not successful, continue the verification process using the original OpenBadgeCredential.
|
||||||
new UriResource(new URI(newID.get()))
|
UriResource uriResource = new UriResource(new URI(newID.get()), null, REFRESH_SERVICE_MIME_TYPES);
|
||||||
.setContext(new ResourceContext(REFRESHED, TRUE)));
|
if (uriResource.exists()) {
|
||||||
|
return this.run(uriResource.setContext(new ResourceContext(REFRESHED, TRUE)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user