Forum Discussion

kjurgensen's avatar
kjurgensen
New Contributor
15 years ago

[Sol](4.0Beta2 Pro) global property not working for password

I am attempting to use 4.0Beta2 Pro. The scripts I have were written in 3.6.1 Pro and work successfully.

The global property for the user's password is not working as the field TestRequest Properties tab:Password field is masked for the Soap request

The password field looks like this in the two versions:
3.6.1 version = ${#Global#kjurgensen_PW}
4.0 beta version = ***********************
If I manually type in the real password in the 4.0 version, the request works successfully.

I looked through the Preferences to find something to turn this masking off, but could not find it. (i really hope it is not obvious )

thanks!

3 Replies

  • Hello,

    All fields that are passwords should be masked now. I tried and could not reproduce this issue you have. Maybe you did not typed property expansion properly? It is a bit harder now to be sure if you put right one in masked field. Properties username and password are used for basic authorization.

    If you create mock service and put this script in "OnRequest Script" tab:

    def authHeader = mockRequest.getRequestHeaders().get('Authorization')

    log.info authHeader

    if (authHeader != null) {
    def st = new StringTokenizer(authHeader.toString());
    if (st.hasMoreTokens()) {
    def basic = st.nextToken();
    if (basic.equalsIgnoreCase("[Basic")) {
    String credentials = st.nextToken();

    def decoder = new sun.misc.BASE64Decoder();
    def userPass = new String(decoder.decodeBuffer(credentials));

    // "userID:password".

    def p = userPass.indexOf(":");
    if (p != -1) {
    userID = userPass.substring(0, p);
    password = userPass.substring(p+1);
    log.info userID
    log.info password
    }
    }
    }
    }
    else
    log.info "no pass"


    You should be able to see if request you sent to mock service has set username/password and what are they.

    Hope this help, let me know
    robert
  • kjurgensen's avatar
    kjurgensen
    New Contributor
    hahah, well. I shutdown 4.0Beta2 Pro yesterday and restarted it just now. works as expected

    thanks for the response
    -keith
  • I thought it was heading to become some dull outdated post, but it really compensated for my time. I will publish a website link to this page on my weblog. I am positive my guests will find that incredibly helpful.
    __________________________________________
    Click on the Ugg Boots Australia could be a surprise for you.