Forum Discussion

lunitic_56137's avatar
lunitic_56137
Icon for Nimbostratus rankNimbostratus
Apr 20, 2017

Parsing the Token from the password field in Edge Client

We have a scenario where the F5 Custom Client is using the API call for "OpenSession( )" which only has two fields for credential mapping. Username and Password. We are also using a token and inputting the password with the token at the end. For example username: boo password: 12345678123456

 

The 1-8 is the LDAP password and the 1-6 is the token password. What would the mcget statement look like in the variable assignemnt box to parse and store the values?

 

1 Reply

  • Hi,

    is the password length 14 characters? do or the only fixed length is the token?

    you can use the following

    session.logon.last.ldappassword (secure)=

    set password [mcget -secure {session.logon.last.password}];
    set tokenid [expr {[string length $password] -6 }];
    set ldappassword [string range $password 0 $tokenid-1];
    unset password tokens;
    return $ldappassword;
    

    session.logon.last.tokenpassword (secure)=

    set password [mcget -secure {session.logon.last.password}];
    set tokenid [expr {[string length $password] -6 }];
    set tokenpassword [string range $password $tokenid end];
    unset password tokens;
    return $tokenpassword;
    

    Edit : I added semicolon at the end of each line. when editing expression, commands are set on one line.