public Session login ( String username , String email , String password ) throws GitLabApiException { if ( ( username == null || username . trim ( ) . length ( ) == 0 ) && ( email == null || email . trim ( ) . length ( ) == 0 ) ) { throw new IllegalArgumentException ( "both username and email cannot be empty or null" ) ; } Form formData = new Form ( ) ; addFormParam ( formData , "email" , email , false ) ; addFormParam ( formData , "password" , password , true ) ; addFormParam ( formData , "login" , username , false ) ; Response response = post ( Response . Status . CREATED , formData , "session" ) ; return ( response . readEntity ( Session . class ) ) ; }
Login to get private token . This functionality is not available on GitLab servers 10 . 2 and above .