AWS cognito medium security documentation change
Summary
Added SAP ABAP SDK code example for AssociateSoftwareToken API with session validation.
Security assessment
The example demonstrates secure MFA token association with explicit session validation and authorization checks. This prevents unauthorized token linking and session hijacking attacks.
Diff
diff --git a/cognito/latest/developerguide/cognito-identity-provider_example_cognito-identity-provider_AssociateSoftwareToken_section.md b/cognito/latest/developerguide/cognito-identity-provider_example_cognito-identity-provider_AssociateSoftwareToken_section.md index 630fb3375..9a67b2f16 100644 --- a//cognito/latest/developerguide/cognito-identity-provider_example_cognito-identity-provider_AssociateSoftwareToken_section.md +++ b//cognito/latest/developerguide/cognito-identity-provider_example_cognito-identity-provider_AssociateSoftwareToken_section.md @@ -283,0 +284,34 @@ There's more on GitHub. Find the complete example and learn how to set up and ru +SAP ABAP + + +**SDK for SAP ABAP** + + +###### Note + +There's more on GitHub. Find the complete example and learn how to set up and run in the [AWS Code Examples Repository](https://github.com/awsdocs/aws-doc-sdk-examples/tree/main/sap-abap/services/cgp#code-examples). + + + TRY. + DATA(lo_result) = lo_cgp->associatesoftwaretoken( + iv_session = iv_session + ). + + ov_secret_code = lo_result->get_secretcode( ). + + MESSAGE 'MFA secret code generated successfully.' TYPE 'I'. + + CATCH /aws1/cx_cgpresourcenotfoundex INTO DATA(lo_ex). + MESSAGE 'Session not found or expired.' TYPE 'E'. + + CATCH /aws1/cx_cgpnotauthorizedex INTO DATA(lo_auth_ex). + MESSAGE 'Not authorized to associate software token.' TYPE 'E'. + ENDTRY. + + + + * For API details, see [AssociateSoftwareToken](https://docs.aws.amazon.com/sdk-for-sap-abap/v1/api/latest/index.html) in _AWS SDK for SAP ABAP API reference_. + + + +