def __init__(self,
                 google_client_id = '',
                 google_client_secret = '',
                 google_redirect_uri = 'http://localhost:8080/oauth2callback',
                 google_scope = 'https://www.googleapis.com/auth/calendar'):
        """
        As a Rasahub plugin initialize itself and create OAuth Server Flow
        """
        super(RasaGoogleCalendar, self).__init__()

        self.client_id = google_client_id
        self.client_secret = google_client_secret
        self.redirect_uri = google_redirect_uri
        self.scope = google_scope

        global client
        global client_id
        global client_secret
        client = OAuth2WebServerFlow(client_id=self.client_id,
                                   client_secret=self.client_secret,
                                   scope=self.scope,
                                   redirect_uri=self.redirect_uri,
                                   access_type='offline', # This is the default
                                   prompt='consent')
        client_id = self.client_id
        client_secret = self.client_secret

        app.secret_key = 'hello world'
        # start flask webserver
        thread.start_new_thread(flaskThread,())
def __init__ ( self , google_client_id = '' , google_client_secret = '' , google_redirect_uri = 'http://localhost:8080/oauth2callback' , google_scope = 'https://www.googleapis.com/auth/calendar' ) : super ( RasaGoogleCalendar , self ) . __init__ ( ) self . client_id = google_client_id self . client_secret = google_client_secret self . redirect_uri = google_redirect_uri self . scope = google_scope global client global client_id global client_secret client = OAuth2WebServerFlow ( client_id = self . client_id , client_secret = self . client_secret , scope = self . scope , redirect_uri = self . redirect_uri , access_type = 'offline' , prompt = 'consent' ) client_id = self . client_id client_secret = self . client_secret app . secret_key = 'hello world' thread . start_new_thread ( flaskThread , ( ) )
As a Rasahub plugin initialize itself and create OAuth Server Flow