{"_id":"589e38c09303db2d00026155","user":"5613e4f8fdd08f2b00437620","version":{"_id":"55faf11ba62ba1170021a9aa","project":"55faf11ba62ba1170021a9a7","__v":38,"createdAt":"2015-09-17T16:58:03.490Z","releaseDate":"2015-09-17T16:58:03.490Z","categories":["55faf11ca62ba1170021a9ab","55faf8f4d0e22017005b8272","55faf91aa62ba1170021a9b5","55faf929a8a7770d00c2c0bd","55faf932a8a7770d00c2c0bf","55faf94b17b9d00d00969f47","55faf958d0e22017005b8274","55faf95fa8a7770d00c2c0c0","55faf96917b9d00d00969f48","55faf970a8a7770d00c2c0c1","55faf98c825d5f19001fa3a6","55faf99aa62ba1170021a9b8","55faf99fa62ba1170021a9b9","55faf9aa17b9d00d00969f49","55faf9b6a8a7770d00c2c0c3","55faf9bda62ba1170021a9ba","5604570090ee490d00440551","5637e8b2fbe1c50d008cb078","5649bb624fa1460d00780add","5671974d1b6b730d008b4823","5671979d60c8e70d006c9760","568e8eef70ca1f0d0035808e","56d0a2081ecc471500f1795e","56d4a0adde40c70b00823ea3","56d96b03dd90610b00270849","56fbb83d8f21c817002af880","573c811bee2b3b2200422be1","576bc92afb62dd20001cda85","5771811e27a5c20e00030dcd","5785191af3a10c0e009b75b0","57bdf84d5d48411900cd8dc0","57ff5c5dc135231700aed806","5804caf792398f0f00e77521","58458b4fba4f1c0f009692bb","586d3c287c6b5b2300c05055","58ef66d88646742f009a0216","58f5d52d7891630f00fe4e77","59a555bccdbd85001bfb1442"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"category":{"_id":"57bdf84d5d48411900cd8dc0","version":"55faf11ba62ba1170021a9aa","__v":0,"project":"55faf11ba62ba1170021a9a7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-24T19:41:01.302Z","from_sync":false,"order":26,"slug":"api-hub","title":"API Hub"},"parentDoc":null,"project":"55faf11ba62ba1170021a9a7","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-02-10T22:03:44.770Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":12,"body":"##Overview\n\nSeven Bridges maintains client applications and libraries which require authentication. Instead of storing your credentials separately for each client application or client library, use a unified configuration file to securely maintain your credentials and authenticate. On this page, learn about [Seven Bridges client applications and libraries](#section-seven-bridges-client-applications-and-libraries) which require authentication, how applications and libraries [check for credentials](#section-hierarchy-of-credentials), and about [using a unified configuration file](#section-unified-configuration-file).\n\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##Seven Bridges client applications and libraries\n\nThe following Seven Bridges client applications and libraries require your Seven Bridges Platform credentials to authenticate.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Application or library name\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"sevenbridges-python is the official Seven Bridges -maintained Python bindings for the Seven Bridges API.\",\n    \"1-1\": \"sevenbridges-r is the official Seven Bridges -maintained R bindings for the Seven Bridges API.\",\n    \"0-0\": \"[sevenbridges-python](doc:api-python-library)\",\n    \"1-0\": \"[sevenbridges-r](doc:api-r-library)\"\n  },\n  \"cols\": 2,\n  \"rows\": 2\n}\n[/block]\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##Hierarchy of credentials\n\nUsing a [unified configuration file](#section-unified-configuration-file) is the preferred method for storing your Seven Bridges credentials. However, Seven Bridges client applications and libraries will check for your credentials in the following order:\n\n  * Explicit parameters passed during initialization\n  * Environmental variables available on an OS level which are defined by users. Credentials can be stored using using the following environmental variables: `SB_API_ENDPOINT` and `SB_AUTH_TOKEN`.\n  * Unified configuration file which stores your credentials for all Seven Bridges client applications and libraries. This is the preferred method for storing your credentials. Learn more about the [unified configuration file](#section-unified-configuration-file) below.\n  * Application or library -specific configuration file which stores your credentials for a specific Seven Bridges client application or library.\n\nNote that the previously used configuration file (such as .sbgrc or .sbg.auth.yml) is no longer supported by [sevenbridges-r starting from version 1.5.5](https://github.com/sbg/sevenbridges-r/releases/tag/v1.5.5) and sevenbridges-python starting from [version 0.7.0](https://github.com/sbg/sevenbridges-python/blob/develop/CHANGES.md).\n\n<div align=\"right\"><a href=\"#top\">top</a></div>\n\n##Unified configuration file\n\nUse a unified configuration file to store all of your credentials for Seven Bridges client applications and libraries. The configuration file, `credentials`, is a INI-like file stored in a directory named `.sevenbridges` underneath your home directory. This location varies across operating systems, but would typically be:\n  * (for Linux and Mac OS X) `$HOME/.sevenbridges/credentials`\n  * (for MS Windows) `%UserProfile%\\.sevenbridges\\credentials`\n\nThe `credentials` configuration file should contain key-value pairs of the following form:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"api_endpoint = https://api.sbgenomics.com/v2\\nauth_token = 2cba934ad7094809bf1700cd80751745\\n\",\n      \"language\": \"text\",\n      \"name\": \"Key-value pairs for the configuration file\"\n    }\n  ]\n}\n[/block]\nThe above key-value pairs comprise one profile. Each profile's name precedes the relevant key-value pairs and is enclosed in brackets. The `credentials` file can consist of multiple profiles, as shown below. For instance, users may have multiple accounts on the same environment:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[default]\\napi_endpoint = https://cgc-api.sbgenomics.com/v2\\nauth_token = 2cba934ad7094809bf1700cd80751745\\n\\n[sbpla]\\napi_endpoint = https://api.sbgenomics.com/v2\\nauth_token = d7090174092cba934a485cd8075bf170\\n\\n[sbpla-gcp]\\napi_endpoint = https://gcp-api.sbgenomics.com/v2\\nauth_token = 90d70172c409ba48934a5c750d80bf17\",\n      \"language\": \"text\",\n      \"name\": \"Sample configuration file content\"\n    }\n  ]\n}\n[/block]\nNote that each profile must have exactly one `api_endpoint` and one `auth-token` key with their corresponding values.\n\n<div align=\"right\"><a href=\"#top\">top</a></div>","excerpt":"","slug":"store-credentials-to-access-seven-bridges-client-applications-and-libraries","type":"basic","title":"Store credentials to access Seven Bridges client applications and libraries"}

Store credentials to access Seven Bridges client applications and libraries


##Overview Seven Bridges maintains client applications and libraries which require authentication. Instead of storing your credentials separately for each client application or client library, use a unified configuration file to securely maintain your credentials and authenticate. On this page, learn about [Seven Bridges client applications and libraries](#section-seven-bridges-client-applications-and-libraries) which require authentication, how applications and libraries [check for credentials](#section-hierarchy-of-credentials), and about [using a unified configuration file](#section-unified-configuration-file). <div align="right"><a href="#top">top</a></div> ##Seven Bridges client applications and libraries The following Seven Bridges client applications and libraries require your Seven Bridges Platform credentials to authenticate. [block:parameters] { "data": { "h-0": "Application or library name", "h-1": "Description", "0-1": "sevenbridges-python is the official Seven Bridges -maintained Python bindings for the Seven Bridges API.", "1-1": "sevenbridges-r is the official Seven Bridges -maintained R bindings for the Seven Bridges API.", "0-0": "[sevenbridges-python](doc:api-python-library)", "1-0": "[sevenbridges-r](doc:api-r-library)" }, "cols": 2, "rows": 2 } [/block] <div align="right"><a href="#top">top</a></div> ##Hierarchy of credentials Using a [unified configuration file](#section-unified-configuration-file) is the preferred method for storing your Seven Bridges credentials. However, Seven Bridges client applications and libraries will check for your credentials in the following order: * Explicit parameters passed during initialization * Environmental variables available on an OS level which are defined by users. Credentials can be stored using using the following environmental variables: `SB_API_ENDPOINT` and `SB_AUTH_TOKEN`. * Unified configuration file which stores your credentials for all Seven Bridges client applications and libraries. This is the preferred method for storing your credentials. Learn more about the [unified configuration file](#section-unified-configuration-file) below. * Application or library -specific configuration file which stores your credentials for a specific Seven Bridges client application or library. Note that the previously used configuration file (such as .sbgrc or .sbg.auth.yml) is no longer supported by [sevenbridges-r starting from version 1.5.5](https://github.com/sbg/sevenbridges-r/releases/tag/v1.5.5) and sevenbridges-python starting from [version 0.7.0](https://github.com/sbg/sevenbridges-python/blob/develop/CHANGES.md). <div align="right"><a href="#top">top</a></div> ##Unified configuration file Use a unified configuration file to store all of your credentials for Seven Bridges client applications and libraries. The configuration file, `credentials`, is a INI-like file stored in a directory named `.sevenbridges` underneath your home directory. This location varies across operating systems, but would typically be: * (for Linux and Mac OS X) `$HOME/.sevenbridges/credentials` * (for MS Windows) `%UserProfile%\.sevenbridges\credentials` The `credentials` configuration file should contain key-value pairs of the following form: [block:code] { "codes": [ { "code": "api_endpoint = https://api.sbgenomics.com/v2\nauth_token = 2cba934ad7094809bf1700cd80751745\n", "language": "text", "name": "Key-value pairs for the configuration file" } ] } [/block] The above key-value pairs comprise one profile. Each profile's name precedes the relevant key-value pairs and is enclosed in brackets. The `credentials` file can consist of multiple profiles, as shown below. For instance, users may have multiple accounts on the same environment: [block:code] { "codes": [ { "code": "[default]\napi_endpoint = https://cgc-api.sbgenomics.com/v2\nauth_token = 2cba934ad7094809bf1700cd80751745\n\n[sbpla]\napi_endpoint = https://api.sbgenomics.com/v2\nauth_token = d7090174092cba934a485cd8075bf170\n\n[sbpla-gcp]\napi_endpoint = https://gcp-api.sbgenomics.com/v2\nauth_token = 90d70172c409ba48934a5c750d80bf17", "language": "text", "name": "Sample configuration file content" } ] } [/block] Note that each profile must have exactly one `api_endpoint` and one `auth-token` key with their corresponding values. <div align="right"><a href="#top">top</a></div>