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

[Docs] Introduction of New Conditional Auth Utility Function: getMaskedValue #20545

Open
dhaura opened this issue Jun 13, 2024 · 1 comment
Open
Assignees

Comments

@dhaura
Copy link
Contributor

dhaura commented Jun 13, 2024

Is your suggestion related to a missing or misleading document? Please describe.

A new conditional authentication utility function is introduced with [1] which can be used to mask content in adaptive authentication script logs by developers. Since this is a newly introduced method, this issue is created to add the said method and its usage into WSO2 IS docs [2].

Describe the improvement

A new utility function (getMaskedValue) is introduced to mask sensitive content in adaptive authentication scripts.

A summary of the implemented method is as follows.

  • Method Name: getMaskedValue
  • Input Parameters: String value [Value to be masked] (ex: [email protected])
  • Return Type: String [Masked value] (ex: j***************m)
  • Functionality:
    • Always mask the given value and return it.

EX: For debugging purposes, if there is a need to add some logs including sensitive content (ex: PII) then it can be masked using the above method as follows.

var onLoginRequest = function(context) {
    executeStep(1, {
        onSuccess: function(context) {
                var email = context.currentKnownSubject.username;
                Log.info("Email of the logged user : " + getMaskedValue(email));
            }
        },
    });
};

[1] - wso2-extensions/identity-conditional-auth-functions#167
[2] - https://is.docs.wso2.com/en/latest/guides/authentication/conditional-auth/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants