Help Center/ ModelArts/ SDK Reference/ Session Authentication/ Authentication Using the Username and Password
Updated on 2024-03-21 GMT+08:00

Authentication Using the Username and Password

This authentication method is available for OBS Management, Training Management, Model Management, and Service Management.

Sample Code

For details about the concepts of the account and user, see Basic Concepts of IAM. For details about how to obtain your account and username information, see Obtaining Account, IAM User, Group, Project, Region, and Agency Information.

  • Authentication using an account
    Set username to your account name.
    1
    2
    from modelarts.session import Session
    session = Session(username='***',  password='***', region_name='***', project_id='***')
    

    If your HUAWEI CLOUD account has been upgraded to a HUAWEI CLOUD account, account authentication will be unavailable. In this case, create an IAM user and use it for authentication.

  • Authentication using an IAM user
    Set account to your account name and username to your IAM username.
    1
    2
    from modelarts.session import Session
    session = Session(account='***', username='***',  password='***', region_name='***', project_id='***')