<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body style='font-size: 10pt; font-family: Verdana,Geneva,sans-serif'>
<p>Good morning,</p>
<p>Thanks for replying back to me. I tried to use the fine_user to get the user id by username, but it seems like not all the user can use the find_user method.</p>
<p>If I do: find_user = conn.identity.find_user(name_or_id='catherine'), it will show me that "You are not authorized to perform the requested action: identity:get_user".</p>
<p>If I do: <span>find_user = </span><span>conn.identity</span><span>.find_user(name_or_id='</span><span>my_user_Id</span><span>'), then it works fine.</span></p>
<p><span>But I would like to use the username to find the user and get the id, so I'm not sure why in this case find_user only work with id not name.</span></p>
<p><br /></p>
<p><span>Thanks and have a great day!</span></p>
<p><span>Catherine</span></p>
<p><span> </span></p>
<p><br /></p>
<p><br /></p>
<p><br /></p>
<p>On 2021-05-08 03:01, Artem Goncharov wrote:</p>
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0"><!-- html ignored --><!-- head ignored --><!-- meta ignored -->Hi<br />
<div> </div>
<div><br />
<blockquote type="cite" style="padding: 0 0.4em; border-left: #1010ff 2px solid; margin: 0">
<div>
<div style="font-size: 10pt; font-family: Verdana,Geneva,sans-serif;">
<div>
<div><span>We are wondering if we could use the user name to get it instead of the user id? If I do get_application_credential(user='catherine', application_credential = 'app_cred_id'), then it will show me an error that "You are not authorized to perform the requested action: identity:get_application_credential". Is there any method that no need user info, can just use the application credential id to get the expiration date? We also didn't find any documentation about the application credential in openstacksdk identity service docs.</span></div>
</div>
</div>
</div>
</blockquote>
<div> </div>
<div>You can use:</div>
<div> </div>
<div>user = conn.identity.find_user(name_or_id = 'my_user')</div>
<div>ac = conn.identity.find_application_credential(user=user, name_or_id='app_cred') </div>
</div>
<div> </div>
<div>Regards,</div>
<div>Artem</div>
</blockquote>
<p><br /></p>
</body></html>