Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authorization value SHA1 -> SHA256 change after 2024-11-30 (IYZWSv2) #9

Open
taylankasap opened this issue Nov 26, 2024 · 0 comments
Open

Comments

@taylankasap
Copy link

https://docs.iyzico.com/en/getting-started/preliminaries/authentication

Please be informed that SHA1 Authentication will no longer be supported after November 30th, 2024. Our esteemed merchants need to enhance their codebases to use HMACSHA256 Authentication.

Please prioritize this update to ensure your systems remain secure and compliant.

The collection is going to need to be updated accordingly.

I use this Pre-request script but you will need to modify to be able to use it because I use environment variables instead of globals.

var iyzicoApiPublicKey = pm.environment.get('iyzicoApiPublicKey')
var iyzicoApiSecretKey = pm.environment.get('iyzicoApiSecretKey')

// Generate iyzicoAuthorization string
function generateAuthorizationString() {
    var hashSha256 = CryptoJS.HmacSHA256(request.headers["x-iyzi-rnd"] + pm.request.url.getPath() + request.data, iyzicoApiSecretKey);
    var signature = "apiKey:" + iyzicoApiPublicKey + "&randomKey:" + request.headers["x-iyzi-rnd"] + "&signature:" + hashSha256;
    var parsedSignature = CryptoJS.enc.Utf8.parse(signature);
    var base64EncodedAuthorization = CryptoJS.enc.Base64.stringify(parsedSignature);
    var iyzicoAuthorization = "IYZWSv2" + " " + base64EncodedAuthorization;
    return iyzicoAuthorization;
}

var iyzicoAuthorization = generateAuthorizationString();
pm.environment.set("iyzicoAuthorization", iyzicoAuthorization);
@taylankasap taylankasap changed the title Authorization value change after 2024-11-30 (IYZWSv2) Authorization value SHA1 -> SHA256 change after 2024-11-30 (IYZWSv2) Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant