docs icon indicating copy to clipboard operation
docs copied to clipboard

Documentation for `X-GitHub-SSO` is suspicious

Open jsoref opened this issue 1 year ago • 6 comments

Code of Conduct

What article on docs.github.com is affected?

https://github.com/github/docs/blob/4f40b22909f8192b70b557ee69fb46ceedb43b89/content/rest/authentication/authenticating-to-the-rest-api.md?plain=1#L54

What part(s) of the article would you like to see updated?

If you receive a 403 Forbidden error, you can follow the URL in the X-GitHub-SSO header to authorize your token. The URL expires after one hour. If you requested data that could come from multiple organizations, the API will not return results from the organizations that require SAML SSO. The X-GitHub-SSO header will indicate the ID of the organizations that require SAML SSO authorization of your {% data variables.product.pat_v1 %}. For example: X-GitHub-SSO: partial-results; organizations=21955855,20582480.

The first two sentences of the text imply that X-GitHub-SSO contains a URL. The last line in the paragraph provides an example of an X-GitHub-SSO field that does not contain a URL.

Additional information

It feels like this text should be split into multiple paragraphs, one for "if you aren't authorized" and one for "if you are authorized". But, I don't know, because I don't have access to this.

jsoref avatar Feb 15 '24 15:02 jsoref

@jsoref Thanks for opening this issue! I'll get this triaged for review ✨

nguyenalex836 avatar Feb 15 '24 18:02 nguyenalex836

Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert :eyes:

github-actions[bot] avatar Feb 15 '24 23:02 github-actions[bot]

(Internal note: asked here)

skedwards88 avatar Feb 15 '24 23:02 skedwards88

Thanks for this issue! We can update the text to say this instead, which I think should clarify your confusion:

If you do not authorize your {% data variables.product.pat_v1 %} for SAML SSO before you try to use it to access an organization that enforces SAML SSO, you may receive a 404 Not Found or a 403 Forbidden error. If you receive a 403 Forbidden error, the X-GitHub-SSO header will include a URL that you can follow to authorize your token. The URL expires after one hour. If you requested data that could come from multiple organizations, instead of returning an error, the API will not return results from the organizations that require SAML SSO and the X-GitHub-SSO header will instead indicate the ID of the organizations that require SAML SSO authorization of your {% data variables.product.pat_v1 %}. For example: X-GitHub-SSO: partial-results; organizations=21955855,20582480.

You or anyone is welcome to open a PR to update this.

skedwards88 avatar Feb 16 '24 17:02 skedwards88

@skedwards88: are you ok w/ splitting it into more than one paragraph? I find these things really hard to read as run-on paragraphs...

jsoref avatar Feb 16 '24 18:02 jsoref

Emeğinize sağlık

gsosm0760 avatar Feb 26 '24 20:02 gsosm0760

Sure. In that case, I'd probably add a new header above the preceding paragraph to indicate that the following content is all about SAML SSO. So something like:

{% data variables.product.pat_generic_caps_plural %} and SAML SSO

{% ifversion fpt or ghec %}If you use a {% data variables.product.pat_v1 %} to access an organization that enforces SAML single sign-on (SSO) for authentication, you will need to authorize your token after creation.{% ifversion pat-v2 %} {% data variables.product.pat_v2_caps %}s are authorized during token creation, before access to the organization is granted.{% endif %} For more information, see "AUTOTITLE."

If you do not authorize your {% data variables.product.pat_v1 %} for SAML SSO before you try to use it to access a single organization that enforces SAML SSO, you may receive a 404 Not Found or a 403 Forbidden error. If you receive a 403 Forbidden error, the X-GitHub-SSO header will include a URL that you can follow to authorize your token. The URL expires after one hour.

If you do not authorize your {% data variables.product.pat_v1 %} for SAML SSO before you try to use it to access multiple organizations, the API will not return results from the organizations that require SAML SSO and the X-GitHub-SSO header will indicate the ID of the organizations that require SAML SSO authorization of your {% data variables.product.pat_v1 %}. For example: X-GitHub-SSO: partial-results; organizations=21955855,20582480.

skedwards88 avatar Mar 07 '24 23:03 skedwards88