Authentication to the GoodData Platform
When developing your own smart business application, you will need to add authentication cookie to all requests coming to GoodData Platform.
Use GoodData Platform users
To obtain the cookie you may call sdk.user.login()
method, which gets the cookie for current user.
import { factory } from 'gooddata';
const sdk = factory();
const loginPromise = sdk.user.login('user@example.com', 'password');
You may ask GoodData Services to create some testing accounts.
Use your user database
Sophisticated way to obtain the authentication cookie is using single sign-on (SSO) method. GoodData Platform implements SAML protocol, in simple words - you authenticate your users to your application, but also you redirect each user to special SAML URL, which sets the correct cookies.
How to setup your server to communicate with GoodData Platform can be found here:
https://help.gooddata.com/display/doc/SAML+SSO+with+GoodData
Make your proxy
For some use cases you may setup your own proxy server, which will first login with a service user and then add the authentication header to all requests.
Careful: If you are just using the development proxy, you will still need to autenticate by going to
/account.html
or calling thesdk.user.login()
method. and filling in valid GoodData credentials.