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

Create a FlexPublicKey including auto authorization prior creating the token #168

Open
xavicosta opened this issue Jan 17, 2024 · 0 comments

Comments

@xavicosta
Copy link

Hi, guys,

I have used the C# FlexServerSDK v0.2.2 for years to create the FlexPublicKey necessary for tokenising card details with the front-end library https://www.npmjs.com/package/@cybersource/flex-sdk-web.

The code we were using in the backend was something like this:

var flexCredentials = new CyberSourceFlexCredentials(
    FlexServerSDK.Authentication.Environment.TEST,
    "...",
    ".-ab6f-4ece-..-.",
    ToSecureString("asdasd/asdasd/asdasd=")
);

var flexService = FlexServiceFactory.Create(flexCredentials, flexServiceConfiguration);

var settings = new KeyRequestSettings
{
    enableAutoAuth = true // Whether an automatic authorization should be performed before generating a token
};

var keyRequestParameters = new KeysRequestParameters(EncryptionType.RsaOaep256, settings);

var result = await flexService.CreateKey(keyRequestParameters);

Now, I realise that the C# FlexServerSDK library is deprecated.

What's the recommended approach to creating a FlexPublicKey with this library that will ensure the auto authorization takes place before creating the token?

Thanks

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