File tree 3 files changed +48
-0
lines changed
3 files changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,35 @@ $ docker run -d \
45
45
--name parse-server \
46
46
yongjhih/parse-server
47
47
```
48
+
49
+ ## How to use with custom authentication
50
+ ###
51
+
52
+ You can add (multiple) custom authentication provider with the environment variables defined below.
53
+
54
+ Mandatory module path: ` AUTH_MYAUTH_MODULE=PATH_TO_MODULE `
55
+
56
+ Optional module option: ` AUTH_MYAUTH_MY_OPTION=value `
57
+
58
+ Replace ` MYAUTH ` by your custom authentication name __ without__ any underscore.
59
+
60
+ Replace ` MY_OPTION ` by your custom authentication parameter name.
61
+
62
+ ### Example
63
+ ``` sh
64
+ $ docker run -d \
65
+ -e APP_ID=${APP_ID} \
66
+ -e MASTER_KEY=${MASTER_KEY} \
67
+ -e AUTH_MYAUTH_MODULE=${AUTH_MYAUTH_MODULE} \
68
+ -e AUTH_MYAUTH_OPTION=${AUTH_MYAUTH_OPTION} \
69
+ -e AUTH_MYAUTH_ANOTHER_OPTION=${AUTH_MYAUTH_ANOTHER_OPTION} \
70
+ -e MASTER_KEY=${MASTER_KEY} \
71
+ -p 1337:1337 \
72
+ --link mongo \
73
+ --name parse-server \
74
+ yongjhih/parse-server:dev
75
+ ```
76
+
48
77
## How to specify parse-server version
49
78
Specify parse-server:2.2.10:
50
79
``` sh
Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ $ APP_ID=YOUR_APP_ID MASTER_KEY=YOUR_MASTER_KEY PARSE_DASHBOARD_ALLOW_INSECURE_H
110
110
## :zap : Advance topics
111
111
* [ How to use with existing mongodb with DATABASE_URI] ( ADVANCE.md#how-to-use-with-existing-mongodb-with-database_uri )
112
112
* [ How to use with existing parse-cloud-code] ( ADVANCE.md#how-to-use-with-existing-parse-cloud-code )
113
+ * [ How to use with custom authentication] ( ADVANCE.md#how-to-use-with-custom-authentication )
113
114
* [ How to specify parse-server version] ( ADVANCE.md#how-to-specify-parse-server-version )
114
115
* [ How to specify latest commit of parse-server] ( ADVANCE.md#how-to-specify-latest-commit-of-parseplatformparse-server-of-image )
115
116
* [ How to start parse dashboard as standalone] ( ADVANCE.md#how-to-start-parse-dashboard-as-standalone )
Original file line number Diff line number Diff line change @@ -205,6 +205,23 @@ if (process.env.DATABASE_TIMEOUT) {
205
205
} ;
206
206
}
207
207
208
+ var auth = { } ;
209
+ for ( var env in process . env ) {
210
+ if ( ! process . env . hasOwnProperty ( env ) ) {
211
+ return ;
212
+ }
213
+
214
+ var env_parameters = / ^ A U T H _ ( [ ^ _ ] * ) _ ( .+ ) / . exec ( env ) ;
215
+
216
+ if ( env_parameters !== null ) {
217
+ if ( typeof auth [ env_parameters [ 1 ] . toLowerCase ( ) ] === "undefined" ) {
218
+ auth [ env_parameters [ 1 ] . toLowerCase ( ) ] = { } ;
219
+ }
220
+
221
+ auth [ env_parameters [ 1 ] . toLowerCase ( ) ] [ env_parameters [ 2 ] . toLowerCase ( ) ] = process . env [ env ] ;
222
+ }
223
+ }
224
+
208
225
var api = new ParseServer ( {
209
226
databaseURI : databaseUri || 'mongodb://localhost:27017/dev' ,
210
227
databaseOptions : databaseOptions ,
@@ -222,6 +239,7 @@ var api = new ParseServer({
222
239
fileKey : process . env . FILE_KEY ,
223
240
filesAdapter : filesAdapter ,
224
241
242
+ auth : auth ,
225
243
facebookAppIds : facebookAppIds ,
226
244
maxUploadSize : process . env . MAX_UPLOAD_SIZE ,
227
245
push : pushConfig ,
You can’t perform that action at this time.
0 commit comments