def METHOD_NAME(cls, username, password):
    """Method to validate dashboard login.
    After enabling the dashboard module validating by API login.
    Args:
        cls (CephAdmin object): cephadm instance.
        username (str) : configured user name to login.
        password (str) : configured password to login.
    """
    LOG.info("wait for some seconds for mgr to setup dashboard")
    sleep(100)
    out, _ = cls.shell(args=["ceph", "mgr", "services"])
    formatted = loads(out)
    # validating dashboard URL
    url = formatted.get("dashboard")
    if not url:
        raise KeyError("Dashboard URL not found")
    LOG.info(f"Dashboard URL to login : {url}")
    LOG.info(
        f"Configured credentials to login username:{username} and password:{password}"
    )
    # Performing dasboard API login test
    data = json.dumps({"username": username, "password": password})
    url_ = f"{url}/api/auth" if not url.endswith("/") else f"{url}api/auth"
    session = requests.Session()
    session.headers = {
        "accept": "application/vnd.ceph.api.v1.0+json",
        "content-type": "application/json",
    }
    resp = session.post(url_, data=data, verify=False)
    if not resp.ok:
        LOG.error(
            f"Dashboard API login is not successful, Status code: \
            {resp.status_code}\nResponse: {resp.text}"
        )
    else:
        LOG.info(f"Dashboard API login is successful, status code : {resp.status_code}")