Skip to content

Commit

Permalink
Update CustomAuthenticateCallbackHandler.java
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenzo-ingenito committed Dec 12, 2024
1 parent e2d5ef8 commit 6e0a6b9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
package it.finanze.sanita.fse2.ms.gtw.statusmanager.config.kafka.oauth2;

import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
Expand Down Expand Up @@ -87,8 +89,7 @@ private OAuthBearerToken getOAuthBearerToken() throws MalformedURLException, Int
synchronized(this) {
if (this.aadClient == null) {
IClientCredential credential = null;
try{
InputStream certificato = new ByteArrayInputStream(FileUtility.getFileFromInternalResources(pfxName));
try (FileInputStream certificato = new FileInputStream(new File(pfxName))) {
credential = ClientCredentialFactory.createFromCertificate(certificato, this.pwd);
} catch(Exception ex) {
log.error("Error while try to crate credential from certificate");
Expand Down

0 comments on commit 6e0a6b9

Please sign in to comment.