1
+
2
+
3
+ <!doctype html>
4
+
5
+ < html xmlns ="http://www.w3.org/1999/xhtml ">
6
+ < head >
7
+ < meta http-equiv ="X-UA-Compatible " content ="IE=Edge " />
8
+ < meta http-equiv ="Content-Type " content ="text/html; charset=utf-8 " />
9
+ < title > Manage Synapse Credentials — Synapse Python Client 1.9.2 documentation</ title >
10
+ < link rel ="stylesheet " href ="_static/custom.css " type ="text/css " />
11
+ < link rel ="stylesheet " href ="_static/pygments.css " type ="text/css " />
12
+
13
+ < script type ="text/javascript " id ="documentation_options " data-url_root ="./ " src ="_static/documentation_options.js "> </ script >
14
+ < script type ="text/javascript " src ="_static/jquery.js "> </ script >
15
+ < script type ="text/javascript " src ="_static/underscore.js "> </ script >
16
+ < script type ="text/javascript " src ="_static/doctools.js "> </ script >
17
+ < script async ="async " type ="text/javascript " src ="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML "> </ script >
18
+ < script type ="text/javascript " src ="_static/bizstyle.js "> </ script >
19
+ < link rel ="shortcut icon " href ="_static/favicon.png "/>
20
+ < link rel ="index " title ="Index " href ="genindex.html " />
21
+ < link rel ="search " title ="Search " href ="search.html " />
22
+ < link rel ="next " title ="Views " href ="Views.html " />
23
+ < link rel ="prev " title ="Synapse Python Client Documentation " href ="index.html " />
24
+ < meta name ="viewport " content ="width=device-width,initial-scale=1.0 ">
25
+ <!--[if lt IE 9]>
26
+ <script type="text/javascript" src="_static/css3-mediaqueries.js"></script>
27
+ <![endif]-->
28
+ </ head > < body >
29
+ < div class ="header ">
30
+ < a href ="https://www.synapse.org/ "> < img src ="_static/synapse_logo.png " alt ='Synapse ' style ="object-fit: scale-down; height:100% "/> </ a >
31
+ < h1 > Synapse Python Client API</ h1 >
32
+ </ div >
33
+
34
+ < div class ="related " role ="navigation " aria-label ="related navigation ">
35
+ < h3 > Navigation</ h3 >
36
+ < ul >
37
+ < li class ="right " style ="margin-right: 10px ">
38
+ < a href ="genindex.html " title ="General Index "
39
+ accesskey ="I "> index</ a > </ li >
40
+ < li class ="right " >
41
+ < a href ="py-modindex.html " title ="Python Module Index "
42
+ > modules</ a > |</ li >
43
+ < li class ="right " >
44
+ < a href ="Views.html " title ="Views "
45
+ accesskey ="N "> next</ a > |</ li >
46
+ < li class ="right " >
47
+ < a href ="index.html " title ="Synapse Python Client Documentation "
48
+ accesskey ="P "> previous</ a > |</ li >
49
+ < li class ="nav-item nav-item-0 "> < a href ="index.html "> Synapse Python Client 1.9.2 documentation</ a > »</ li >
50
+ </ ul >
51
+ </ div >
52
+ < div class ="sphinxsidebar " role ="navigation " aria-label ="main navigation ">
53
+ < div class ="sphinxsidebarwrapper ">
54
+ < div id ="searchbox " style ="display: none " role ="search ">
55
+ < h3 > Quick search</ h3 >
56
+ < div class ="searchformwrapper ">
57
+ < form class ="search " action ="search.html " method ="get ">
58
+ < input type ="text " name ="q " />
59
+ < input type ="submit " value ="Go " />
60
+ < input type ="hidden " name ="check_keywords " value ="yes " />
61
+ < input type ="hidden " name ="area " value ="default " />
62
+ </ form >
63
+ </ div >
64
+ </ div >
65
+ < script type ="text/javascript "> $ ( '#searchbox' ) . show ( 0 ) ; </ script >
66
+ < h3 > < a href ="index.html "> Table of Contents</ a > </ h3 >
67
+ < ul >
68
+ < li > < a class ="reference internal " href ="# "> Manage Synapse Credentials</ a > < ul >
69
+ < li > < a class ="reference internal " href ="#one-time-login "> One Time Login</ a > </ li >
70
+ < li > < a class ="reference internal " href ="#use-synapseconfig "> Use < cite > .synapseConfig</ cite > </ a > </ li >
71
+ < li > < a class ="reference internal " href ="#letting-the-operating-system-manage-your-synapse-credentials "> Letting the Operating System Manage Your Synapse Credentials</ a > </ li >
72
+ </ ul >
73
+ </ li >
74
+ </ ul >
75
+
76
+ < h4 > Previous topic</ h4 >
77
+ < p class ="topless "> < a href ="index.html "
78
+ title ="previous chapter "> Synapse Python Client Documentation</ a > </ p >
79
+ < h4 > Next topic</ h4 >
80
+ < p class ="topless "> < a href ="Views.html "
81
+ title ="next chapter "> Views</ a > </ p >
82
+ < div role ="note " aria-label ="source link ">
83
+ < h3 > This Page</ h3 >
84
+ < ul class ="this-page-menu ">
85
+ < li > < a href ="_sources/Credentials.rst.txt "
86
+ rel ="nofollow "> Show Source</ a > </ li >
87
+ </ ul >
88
+ </ div >
89
+ </ div >
90
+ </ div >
91
+
92
+ < div class ="document ">
93
+ < div class ="documentwrapper ">
94
+ < div class ="bodywrapper ">
95
+ < div class ="body " role ="main ">
96
+
97
+ < div class ="section " id ="manage-synapse-credentials ">
98
+ < h1 > Manage Synapse Credentials< a class ="headerlink " href ="#manage-synapse-credentials " title ="Permalink to this headline "> ¶</ a > </ h1 >
99
+ < p > There are multiple ways one can login to Synapse. We recommend users to choose the method that fits their workflow.</ p >
100
+ < div class ="section " id ="one-time-login ">
101
+ < h2 > One Time Login< a class ="headerlink " href ="#one-time-login " title ="Permalink to this headline "> ¶</ a > </ h2 >
102
+ < p > Use < cite > username</ cite > and < cite > password</ cite > to login as follows:</ p >
103
+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="kn "> import</ span > < span class ="nn "> synapseclient</ span >
104
+ < span class ="n "> syn</ span > < span class ="o "> =</ span > < span class ="n "> synapseclient</ span > < span class ="o "> .</ span > < span class ="n "> login</ span > < span class ="p "> (</ span > < span class ="s2 "> "username"</ span > < span class ="p "> ,</ span > < span class ="s2 "> "password"</ span > < span class ="p "> )</ span >
105
+ </ pre > </ div >
106
+ </ div >
107
+ </ div >
108
+ < div class ="section " id ="use-synapseconfig ">
109
+ < h2 > Use < cite > .synapseConfig</ cite > < a class ="headerlink " href ="#use-synapseconfig " title ="Permalink to this headline "> ¶</ a > </ h2 >
110
+ < p > For writing code using the Synapse Python client, that is easy to share with others, please do not include your credentials in the code. Instead, please use < cite > .synapseConfig</ cite > file to manage your credentials.</ p >
111
+ < p > When installing the Synapse Python client, the < cite > .synapseConfig</ cite > is added to your home directory. Open the < cite > .synapseConfig</ cite > file and find the following section:</ p >
112
+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="c1 "> #[authentication]</ span >
113
+ < span class ="c1 "> #username = <username></ span >
114
+ < span class ="c1 "> #password = <password></ span >
115
+ < span class ="c1 "> #apikey = <apikey></ span >
116
+ </ pre > </ div >
117
+ </ div >
118
+ < p > To enable this section, uncomment it. You will only need to specify either < cite > username</ cite > and < cite > password</ cite > or < cite > username</ cite > and < cite > apikey</ cite > . For security purposes, we recommend that you use Synapse < cite > apikey</ cite > instead of your < cite > password</ cite > :</ p >
119
+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="p "> [</ span > < span class ="n "> authentication</ span > < span class ="p "> ]</ span >
120
+ < span class ="n "> username</ span > < span class ="o "> =</ span > < span class ="o "> <</ span > < span class ="n "> username</ span > < span class ="o "> ></ span >
121
+ < span class ="n "> apikey</ span > < span class ="o "> =</ span > < span class ="o "> <</ span > < span class ="n "> apikey</ span > < span class ="o "> ></ span >
122
+ </ pre > </ div >
123
+ </ div >
124
+ < p > Now, you can login without specifying your < cite > username</ cite > and < cite > password</ cite > :</ p >
125
+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="kn "> import</ span > < span class ="nn "> synapseclient</ span >
126
+ < span class ="n "> syn</ span > < span class ="o "> =</ span > < span class ="n "> synapseclient</ span > < span class ="o "> .</ span > < span class ="n "> login</ span > < span class ="p "> ()</ span >
127
+ </ pre > </ div >
128
+ </ div >
129
+ </ div >
130
+ < div class ="section " id ="letting-the-operating-system-manage-your-synapse-credentials ">
131
+ < h2 > Letting the Operating System Manage Your Synapse Credentials< a class ="headerlink " href ="#letting-the-operating-system-manage-your-synapse-credentials " title ="Permalink to this headline "> ¶</ a > </ h2 >
132
+ < p > For users who would like to save their credentials and let other OS configured applications (like keychain in Mac) manage credentials for them, when logging in for the first time, use:</ p >
133
+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="kn "> import</ span > < span class ="nn "> synapseclient</ span >
134
+ < span class ="n "> syn</ span > < span class ="o "> =</ span > < span class ="n "> synapseclient</ span > < span class ="o "> .</ span > < span class ="n "> login</ span > < span class ="p "> (</ span > < span class ="s2 "> "username"</ span > < span class ="p "> ,</ span > < span class ="s2 "> "password"</ span > < span class ="p "> ,</ span > < span class ="n "> rememberMe</ span > < span class ="o "> =</ span > < span class ="kc "> True</ span > < span class ="p "> )</ span >
135
+ </ pre > </ div >
136
+ </ div >
137
+ < p > The application (keychain in Mac) will then prompt you to allow Python to access these credentials. Please choose “Yes” or “OK”.</ p >
138
+ < p > The second time you login, you will not have to enter your < cite > username</ cite > or < cite > password</ cite > :</ p >
139
+ < div class ="highlight-default notranslate "> < div class ="highlight "> < pre > < span > </ span > < span class ="kn "> import</ span > < span class ="nn "> synapseclient</ span >
140
+ < span class ="n "> syn</ span > < span class ="o "> =</ span > < span class ="n "> synapseclient</ span > < span class ="o "> .</ span > < span class ="n "> login</ span > < span class ="p "> ()</ span >
141
+ </ pre > </ div >
142
+ </ div >
143
+ </ div >
144
+ </ div >
145
+
146
+
147
+ </ div >
148
+ </ div >
149
+ </ div >
150
+ < div class ="clearer "> </ div >
151
+ </ div >
152
+ < div class ="related " role ="navigation " aria-label ="related navigation ">
153
+ < h3 > Navigation</ h3 >
154
+ < ul >
155
+ < li class ="right " style ="margin-right: 10px ">
156
+ < a href ="genindex.html " title ="General Index "
157
+ > index</ a > </ li >
158
+ < li class ="right " >
159
+ < a href ="py-modindex.html " title ="Python Module Index "
160
+ > modules</ a > |</ li >
161
+ < li class ="right " >
162
+ < a href ="Views.html " title ="Views "
163
+ > next</ a > |</ li >
164
+ < li class ="right " >
165
+ < a href ="index.html " title ="Synapse Python Client Documentation "
166
+ > previous</ a > |</ li >
167
+ < li class ="nav-item nav-item-0 "> < a href ="index.html "> Synapse Python Client 1.9.2 documentation</ a > »</ li >
168
+ </ ul >
169
+ </ div >
170
+ < div class ="footer ">
171
+ © < a href ="http://sagebase.org/ "> Sage Bionetworks</ a > .
172
+ Last updated on Feb 11, 2019.
173
+ Created using < a href ="http://sphinx-doc.org/ "> Sphinx</ a > 1.8.1.
174
+ </ div >
175
+ < script type ="text/javascript ">
176
+ ( function ( i , s , o , g , r , a , m ) { i [ 'GoogleAnalyticsObject' ] = r ; i [ r ] = i [ r ] || function ( ) {
177
+ ( i [ r ] . q = i [ r ] . q || [ ] ) . push ( arguments ) } , i [ r ] . l = 1 * new Date ( ) ; a = s . createElement ( o ) ,
178
+ m = s . getElementsByTagName ( o ) [ 0 ] ; a . async = 1 ; a . src = g ; m . parentNode . insertBefore ( a , m )
179
+ } ) ( window , document , 'script' , '//www.google-analytics.com/analytics.js' , 'ga' ) ;
180
+ ga ( 'create' , 'UA-44781812-1' , 'synapse.org' ) ;
181
+ ga ( 'send' , 'pageview' ) ;
182
+ </ script >
183
+ </ body >
184
+ </ html >
0 commit comments