# API 头像 URL 与 SSO 头像 URL 不同

**URL:** <https://meta.discourse.org/t/api-avatar-url-and-sso-avatar-url-are-different/153587>\
**Category:** Support\
**Created:** [2020年六月2日 15:59 UTC](https://meta.discourse.org/t/api-avatar-url-and-sso-avatar-url-are-different/153587 "2020-06-02T15:59:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hjalali](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hjalali/32/181824_2.png) [@hjalali](https://meta.discourse.org/u/hjalali)\
**Post date:** [2020年六月2日 15:59 UTC](https://meta.discourse.org/t/api-avatar-url-and-sso-avatar-url-are-different/153587/1 "2020-06-02T15:59:02Z")

</div>

我目前通过两种方式获取用户信息：

SSO 提供的头像 URL 如下：  
[https://cdn.WEBSITE.COM/original/1X/42270b70f2cbcfd168082aa6be55cf98d5b387bf.jpeg](https://cdn.WEBSITE.COM/original/1X/42270b70f2cbcfd168082aa6be55cf98d5b387bf.jpeg)

我无法通过 API 获取相同的链接，因为 API 使用 user/{username}.json 会生成：  
/user\_avatar/www.WEBSITE.COM/{username}/{size}/162\_2.png

我该如何获取 SSO 提供的那个链接？因为我有一个关联的子域名，并且我的图片托管在 CDN 上。

谢谢。
