[4.6] Input field password string value is ************

I have an input field whose content type is password. When I try to get the string from input field all it’s giving me is a line of asterix’

string _password = inputPassword.GetComponent<InputField>().text;

_password is “*****************”

What am I doing wrong here?

Found out what was going wrong.
I had a public RectTransform which in the editor I assigned the child ‘Text’, not the actual input field because in previous betas there was no direct access to the .text property.

I changed it to the actual InputField object and accessing it through there works properly

When I try this, I get the password instead of a lot of asterix. Are you sure you are not overwriting it somewhere?

To test this I have a empty Scene with a Canvas and A child. This child has a RectTransform, Canvas Renderer, Text and a InputField component.

Then I also added the following script:

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Test : MonoBehaviour
{
	void Update()
    {
        Debug.Log(GetComponent<InputField>().text + " : " + GetComponent<Text>().text);
	}
}

The result in the console then looks like this:

YourPassword : ************

(Unity 4.6.0f2)