0

I have tried the bluemix service 'APP ID' for node.js project which I downloaded from APP ID service instance only. The application runs well with Google and Facebook authentication.

But I have to apply authentication to Python Flask web application. For this,I have followed the github link . Here, I have provided 'clientid', 'secret' and 'redirect_uri' which I got from the 'Service Credentials' tab of the 'APP ID' instance in bluemix. After running the app, I am getting login page but when I click 'Login' button then I am getting the error 'tenandid is in invalid format'.

Please suggest where I am doing wrong.

Thanks in advance !

Regards, Rahul Modi

Rahul Modi
  • 11
  • 4
  • Just to verify: You manually set the variables like clientID and did not bind AppID to the Python app. Correct? – data_henrik Jul 05 '17 at 07:13
  • I was able to clone the GH repo, push the app, bind AppID service to it, restage. Login via Google works for me – data_henrik Jul 05 '17 at 07:24
  • I did not bind the AppID to the python app. I am running it from outside bluemix. I will try pushing and binding the app. Thanks Henrik – Rahul Modi Jul 05 '17 at 11:54

1 Answers1

0

I solved the error my self. I just provided clientId, secret, redirectUri and serverUrl in the file serviceConfig.py file of the GitHub python project.

There is need to change this file by providing the above parameters otherwise you may land into the error on the line "clientId = serviceConfig.clientId" of 'welcome.py' because clientId is not accessible from serviceConfig class. The same case for 'secret' as well. Hence, define them separately in serviceConfig.py file.

The four parameters looks like below:

serverUrl='https://appid-oauth.ng.bluemix.net/oauth/v3/1b668c6a-XXXX-XXXX-XXXX-c4633e8e0c78'

redirectUri='http://localhost:5000/afterauth'

secret='NjNiODY5NDQtOXXXXXXXXXXXXXXXXXXXXzUxNDMzNzYxYjAy'

clientId='6284418c-XXXX-XXXX-XXXX-af8bf44588ec'

All these parameters you can collect from the 'Service Credentials' tab of the 'APP ID' instance in Bluemix.

Note: No need to change anything in 'welcome.py' file.

Rahul Modi
  • 11
  • 4