Skip to content

Commit db7b564

Browse files
committed
readme strategy options
this resolves jaredhanson#28, resolves jaredhanson#46, resolves jaredhanson#57, resolves jaredhanson#91
1 parent a948096 commit db7b564

File tree

1 file changed

+76
-0
lines changed

1 file changed

+76
-0
lines changed

README.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,82 @@ app.get('/auth/example/callback',
7575
});
7676
```
7777

78+
## Strategy Options
79+
80+
#### authorizationURL
81+
REQUIRED
82+
`{ authorizationURL: string }`
83+
URL used to obtain an authorization grant
84+
85+
#### tokenURL
86+
REQUIRED
87+
`{ tokenURL: string }`
88+
URL used to obtain an access token
89+
90+
#### clientID
91+
REQUIRED
92+
`{ clientID: string }`
93+
The client identifier issued to the client by the OAuth 2.0 service.
94+
95+
#### clientSecret
96+
REQUIRED
97+
`{ clientSecret: string }`
98+
The client secret issued to the client by the OAuth 2.0 service.
99+
100+
#### callbackURL
101+
OPTIONAL
102+
`{ callbackURL: string }`
103+
URL to which the service provider will redirect the user after obtaining authorization. The URL can be relative or fully qualified; when relative, the original URL of the authorization request will be prepended to the relative URL.
104+
105+
#### customHeaders
106+
OPTIONAL
107+
`{ customHeaders: Object }`
108+
Custom headers you can pass with the authorization request.
109+
110+
#### passReqToCallback
111+
OPTIONAL
112+
`{ passReqToCallback: boolean }`
113+
When set to `true`, the first argument sent to the verify callback is the request, `http.IncomingMessage`, (default: `false`)
114+
115+
#### proxy
116+
OPTIONAL
117+
`{ proxy: boolean }`
118+
Used when resolving a relative callbackURL. When set to `true`, `req.headers['x-forwarded-proto']` and `req.headers['x-forwarded-host']` will be used otherwise `req.connection.encrypted` and `req.headers.host` will be used.
119+
120+
_Note_: if your webserver, e.g. `Express`, provides `req.app.get` and the value `req.app.get('trust proxy')` is set, proxy option will automatically be set to `true`.
121+
122+
#### scope
123+
OPTIONAL
124+
`{ scope: Array|string }`
125+
The scope of the access request made by the client of the OAuth 2.0 service; the strings are defined by the OAuth 2.0 service.
126+
127+
When the scope is provided as a list of strings, each string should be separated by a space as per the OAuth 2.0 spec. When the scope is provided as an Array, each array element will be joined by the scopeSeparator.
128+
129+
#### scopeSeparator
130+
OPTIONAL
131+
`{ scopeSeparator: string }`
132+
The separator used to join the scope strings when the `scope` is provided as an Array (default: `single space`).
133+
134+
#### sessionKey
135+
OPTIONAL
136+
`{ sessionKey: string }`
137+
The key to use to store the state string when the `state` option is set to `true`. (default: 'oauth2:' + url.parse(options.authorizationURL).hostname)
138+
139+
#### skipUserProfile
140+
OPTIONAL
141+
`{ skipUserProfile: boolean }`
142+
Whether or not to return the user profile information of the user granting authorization to their account information.
143+
144+
#### state
145+
OPTIONAL
146+
`{ sessionKey: boolean }`
147+
When set to `true`, a state string with be created, stored, sent along with the authorization request and validated
148+
149+
#### store
150+
OPTIONAL
151+
`{ store: Function }`
152+
The store to use when storing the state string (default: `SessionStore`, `req.session[sessionKey]`, requires session middleware such as `express-session`). See the [NullStore][./lib/state/null.js] for an example of a store function.
153+
78154
## Related Modules
79155

80156
- [passport-oauth1](https://github.com/jaredhanson/passport-oauth1) — OAuth 1.0 authentication strategy

0 commit comments

Comments
 (0)