-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test external auth providers credentials (#745)
Test Facebook credentials
- Loading branch information
1 parent
0c99911
commit f248a3c
Showing
4 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,3 +187,16 @@ For the purpose of the tests the token could be generated by the following proce | |
``` | ||
* Once you have the token you can use it to login in the tests with `app.login(Credentials.jwt(token))`. Be sure that the public key configured in the cloud apps is from the correct key pair and corresponds to the private key used for generating this token. | ||
|
||
## Manually configure Facebook authentication providers | ||
|
||
### Facebook login | ||
|
||
1. Login to https://developers.facebook.com/ with account [email protected] | ||
2. Go to facebook app `"DartCI"` | ||
3. Go to [Settings/Basic](https://developers.facebook.com/apps/1265617494254819/settings/basic/) and you will find `App ID` and `App secret` | ||
4. Following [Facebook Authentication Instruction](https://www.mongodb.com/docs/atlas/app-services/authentication/facebook/) you have to enable facebook authentication provider in [cloud-qa](https://cloud-qa.mongodb.com/) app. Then set `Client ID = App ID` and `Client Secret = App secret` | ||
5. Go back to https://developers.facebook.com/ in menu [Roles/Test Users](https://developers.facebook.com/apps/1265617494254819/roles/test-users/) and select `"Get a user access token"` option for one of the test users. | ||
This access token could be used for facebook login tests with `Credentials.facebook(accessToken)`. | ||
This token will expire fast. If you need long term token you can receive it from this request | ||
https://graph.facebook.com/v14.0/oauth/access_token?grant_type=fb_exchange_token&client_id={`Client ID`}&client_secret={`Client Secret`}&fb_exchange_token={copied access token from `"Get a user access token"`} | ||
6. Use the recieved token in the test. It will be available for 3.5 days. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters