@@ -78,9 +78,9 @@ class LoginConfig(pydantic.BaseModel):
7878 command_line = 'token_endpoint' ,
7979 default = None ,
8080 description = 'The url to get a token from device auth, client auth, or refresh token.' )
81- client_id : str = pydantic .Field (
81+ client_id : str | None = pydantic .Field (
8282 command_line = 'client_id' ,
83- default = 'osmo-device' ,
83+ default = None ,
8484 description = 'The client id for the OSMO application.' )
8585 login_method : Literal ['password' , 'token' ] | None = pydantic .Field (
8686 command_line = 'login_method' ,
@@ -176,17 +176,18 @@ def owner_password_login(config: LoginConfig,
176176 url : str ,
177177 username : str ,
178178 password : str ,
179- user_agent : str | None ) -> LoginStorage :
179+ user_agent : str | None , ) -> LoginStorage :
180180 """ Log in using OAUTH2 resource owner password flow """
181181 # Do not allow IPV6 which doesn't work in some of our configurations
182182 urllib3 .util .connection .HAS_IPV6 = False
183183
184184 headers = {}
185185 if user_agent :
186186 headers ['User-Agent' ] = user_agent
187- token_endpoint = config .token_or_default (url )
187+ login_info = fetch_login_info (url )
188+ token_endpoint = config .token_endpoint or login_info ['token_endpoint' ]
188189 result = requests .post (token_endpoint , data = {
189- 'client_id' : config .client_id ,
190+ 'client_id' : config .client_id or login_info [ 'client_id' ] ,
190191 'username' : username ,
191192 'password' : password ,
192193 'grant_type' : 'password' ,
0 commit comments