#NEWLINE# def authorization_url( self , client_id , redirect_uri , approval_prompt = 'auto' , scope = None , state = None ) : #NEWLINE# #INDENT# '\n        Get the URL needed to authorize your application to access a Strava user\'s information.\n\n        See http://strava.github.io/api/v3/oauth/\n\n        :param client_id: The numeric developer client id.\n        :type client_id: int\n\n        :param redirect_uri: The URL that Strava will redirect to after successful (or failed) authorization.\n        :type redirect_uri: str\n\n        :param approval_prompt: Whether to prompt for approval even if approval already granted to app.\n                                Choices are \'auto\' or \'force\'.  (Default is \'auto\')\n        :type approval_prompt: str\n\n        :param scope: The access scope required.  Omit to imply "public".\n                      Valid values are \'write\', \'view_private\', \'view_private,write\', \'write,view_private\'.\n        :type scope: str\n\n        :param state: An arbitrary variable that will be returned to your application in the redirect URI.\n        :type state: str\n\n        :return: The URL to use for authorization link.\n        :rtype: str\n        ' #NEWLINE# assert ( approval_prompt in ( 'auto' , 'force' ) ) #NEWLINE# if isinstance ( scope , ( list , tuple ) ) : #NEWLINE# #INDENT# scope = ',' . join ( scope ) #NEWLINE# #UNINDENT# assert ( scope in ( None , 'write' , 'view_private' , 'write,view_private' , 'view_private,write' ) ) #NEWLINE# params = { #NEWLINE# #INDENT# 'client_id' : client_id , #NEWLINE# 'redirect_uri' : redirect_uri , #NEWLINE# 'approval_prompt' : approval_prompt , #NEWLINE# 'response_type' : 'code' , #NEWLINE# #UNINDENT# } #NEWLINE# if ( scope is not None ) : #NEWLINE# #INDENT# params [ 'scope' ] = scope #NEWLINE# #UNINDENT# if ( state is not None ) : #NEWLINE# #INDENT# params [ 'state' ] = state #NEWLINE# #UNINDENT# return urlparse . urlunsplit ( ( 'https' , self . server , '/oauth/authorize' , urlencode ( params ) , '' ) )