<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">As outlined here: <a href="https://doc.dovecot.org/configuration_manual/authentication/oauth2/">https://doc.dovecot.org/configuration_manual/authentication/oauth2/</a></div><div><br></div><div>Can Postman <a href="https://identity.foo.mylocal:9443/oauth2/token">https://identity.foo.mylocal:9443/oauth2/token</a> OK.</div><div><br></div><div>Using this command to generate the base64 token: echo -en 'n,a=<a href="mailto:test@foo.com">test@foo.com</a>,\001host=localhost\001port=143\001auth=Bearer S3cure!Password\001\001' | base64 -w0; echo</div><div><br></div><div>I telnet to localhost 143, and run 01 AUTHENTICATE OAUTHBEARER {TOKEN}.</div><div><br></div><div>Get 'User id is not available for user: FOO.MYLOCAL/test@carbon.super' (HTTP 500). It could be because Dovecot is just sending a username instead of the full email address? I can generate the same 500 error by just sending the username in Postman.</div><div><br></div><div>***dovecot-oauth.conf.ext***</div><div><br></div><div><div>introspection_mode = post</div><div>introspection_url = https://adminusername:adminpassword@identity.foo.mylocal:9443/oauth2/introspect</div><div>username_attribute = username</div><div>tls_allow_invalid_cert = yes</div><div>active_attribute = active</div><div>active_value = true</div><div>use_grant_password = yes<br># Have tried this, no change.</div><div>#username_format = %n<br></div><div><br></div><div>client_id = {CLIENTID}</div><div>client_secret = {CLIENTSECRET}</div><div><br></div><div>grant_url = <a href="https://identity.foo.mylocal:9443/oauth2/token">https://identity.foo.mylocal:9443/oauth2/token</a></div><div>tokeninfo_url = <a href="https://identity.foo.mylocal:9443/oauth2/tokeninfo?oauth=">https://identity.foo.mylocal:9443/oauth2/tokeninfo?oauth=</a></div><div>pass_attrs = pass=%{oauth2:access_token}</div></div><div><br></div><div>***dovecot.conf***</div><div><br></div><div><div>auth_mechanisms = $auth_mechanisms oauthbearer xoauth2</div><div><br></div><div>passdb {</div><div><br></div><div>driver = oauth2</div><div>  mechanisms = xoauth2 oauthbearer</div><div>  args = /etc/dovecot/dovecot-oauth2.conf.ext</div><div>}</div></div></div></div></div></div></div></div></div></div></div>