Skip to content

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

@xavicosta

Description

@xavicosta

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions