{ "opencollection": "1.0.0", "info": { "name": "NPR Identity Service Authorization API", "version": "2" }, "items": [ { "info": { "name": "Authorization", "type": "folder" }, "items": [ { "info": { "name": "NPR Create a new OAuth2 access token", "type": "http" }, "http": { "method": "POST", "url": "https://identity.api.npr.org/v2/token", "body": { "type": "form-urlencoded", "data": [ { "name": "grant_type", "value": "" }, { "name": "client_id", "value": "" }, { "name": "client_secret", "value": "" }, { "name": "code", "value": "" }, { "name": "redirect_uri", "value": "" }, { "name": "refresh_token", "value": "" }, { "name": "scope", "value": "" }, { "name": "token_type_hint", "value": "" } ] } }, "docs": "Please be aware that the required parameters are contingent on the `grant_type` that you select.\n\nFor the `authorization_code` grant type, you are **required** to pass in the `code` and `redirect_uri` parameters.\n\nFor the `client_credentials` grant type, you do not need to pass in any additional parameters beyond the basic requirements. `code` and `redirect_uri` parameters will be ignored.\n\nFor the `device_code` grant type, you are **required** to pass in the `code` parameter. If you are a third" }, { "info": { "name": "NPR Show a web-based login/signup form to a user", "type": "http" }, "http": { "method": "GET", "url": "https://identity.api.npr.org/v2/authorize", "params": [ { "name": "client_id", "value": "", "type": "query", "description": "The client's ID" }, { "name": "redirect_uri", "value": "", "type": "query", "description": "The client's URL to redirect to if the authentication is approved" }, { "name": "response_type", "value": "", "type": "query", "description": "The type of response; currently, only `code` is supported" }, { "name": "scope", "value": "", "type": "query", "description": "A space-separated list of scope(s) requested by the application" }, { "name": "email", "value": "", "type": "query", "description": "An email address to prepopulate on the login screen" }, { "name": "state", "value": "", "type": "query", "description": "A CSRF token generated by the client, to be roundtripped through the request for added security" }, { "name": "prompt", "value": "", "type": "query", "description": "Optional prompt parameter to be passed to Akamai /login/authorize" } ] }, "docs": "If the parameters passed to this endpoint are correct, it will redirect to `npr.org/oauth2/login` for the user to complete the sign-in.\n\nCurrently acceptable values for `scope` are any combination of the following:\n- `identity.readonly` - for read-only access to the Identity Service\n- `identity.write` - for write access to the Identity Service\n- `listening.readonly` - for read-only access to the Listening Service\n- `listening.write` - for write access to the Listening Service\n- `localactivation`" }, { "info": { "name": "NPR Initiate an OAuth2 login flow for limited input devices", "type": "http" }, "http": { "method": "POST", "url": "https://identity.api.npr.org/v2/device", "body": { "type": "form-urlencoded", "data": [ { "name": "client_id", "value": "" }, { "name": "client_secret", "value": "" }, { "name": "scope", "value": "" } ] } }, "docs": "This flow should only be used by clients who cannot show a native webview or do not have advanced input controls. It is an alternative to `GET /v2/authorize`.\n\nThird-party clients will need to use one or the other of these two endpoints, but they will generally not use both." }, { "info": { "name": "NPR Revoke an existing OAuth2 access token", "type": "http" }, "http": { "method": "POST", "url": "https://identity.api.npr.org/v2/token/revoke", "headers": [ { "name": "Authorization", "value": "" } ], "body": { "type": "form-urlencoded", "data": [ { "name": "token", "value": "" }, { "name": "token_type_hint", "value": "" } ] } }, "docs": "Our implementation follows the proposed IETF specification [RFC-7009](https://tools.ietf.org/html/rfc7009).\n\nIf your client application offers the ability to for a logged-in user to log out, and you have access to a long-lived\n`client_credentials` token (i.e. you have generated one that you are storing securely for the lifetime of the entire app\ninstall), we suggest (but do not require) that you call this endpoint and revoke the access token belonging to the\nlogged-in user as part of your logout" } ] } ], "bundled": true }