Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmanos committed Nov 1, 2024
2 parents ae0ea23 + f062c8d commit 0bc435b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ REACT_APP_VERSION=$npm_package_version
GENERATE_SOURCEMAP=false
REACT_APP_DISPLAY_CONSOLE=true
REACT_APP_WEBAUTHN_RPID=localhost
REACT_APP_OPENID4VCI_REDIRECT_URI=http://localhost:3000/
REACT_APP_OPENID4VCI_REDIRECT_URI=https://secure.wwwallet.local:8443/
REACT_APP_OPENID4VP_SAN_DNS_CHECK=false
REACT_APP_OPENID4VP_SAN_DNS_CHECK_SSL_CERTS=false
REACT_APP_VALIDATE_CREDENTIALS_WITH_TRUST_ANCHORS=true
REACT_APP_OPENID4VCI_EID_CLIENT_URL=http://127.0.0.1:24727/eID-Client
REACT_APP_PID_CREDENTIAL_ISSUER_IDENTIFIER=http://
25 changes: 25 additions & 0 deletions src/context/ContainerContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,31 @@ export const ContainerContextProvider = ({ children }) => {
...c
});
},

async function authorizationRequestModifier(credentialIssuerIdentifier: string, url: string, request_uri?: string, client_id?: string) {
if (credentialIssuerIdentifier !== process.env.REACT_APP_PID_CREDENTIAL_ISSUER_IDENTIFIER) {
return { url };
}
const isMobile = window.innerWidth <= 480;
const eIDClientURL = isMobile ? process.env.REACT_APP_OPENID4VCI_EID_CLIENT_URL.replace('http', 'eid') : process.env.REACT_APP_OPENID4VCI_EID_CLIENT_URL;
console.log("Eid client url = ", eIDClientURL)
const urlObj = new URL(url);
// Construct the base URL
const baseUrl = `${urlObj.protocol}//${urlObj.hostname}${urlObj.pathname}`;

// Parameters
// Encode parameters
const encodedClientId = encodeURIComponent(client_id);
const encodedRequestUri = encodeURIComponent(request_uri);
const tcTokenURL = `${baseUrl}?client_id=${encodedClientId}&request_uri=${encodedRequestUri}`;

const newLoc = `${eIDClientURL}?tcTokenURL=${encodeURIComponent(tcTokenURL)}`

console.log("new loc = ", newLoc)
return {
url: newLoc
};
},
);

const httpProxy = cont.resolve<IHttpProxy>('HttpProxy');
Expand Down
3 changes: 3 additions & 0 deletions src/lib/services/OpenID4VCIClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export class OpenID4VCIClient implements IOpenID4VCIClient {

const formData = new URLSearchParams();

console.log({ code_challenge, code_verifier })
console.log("Meta = ", this.config.credentialIssuerMetadata)
console.log("Conf id = ", credentialConfigurationId)
const selectedCredentialConfigurationSupported = this.config.credentialIssuerMetadata.credential_configurations_supported[credentialConfigurationId];
formData.append("scope", selectedCredentialConfigurationSupported.scope);

Expand Down

0 comments on commit 0bc435b

Please sign in to comment.