Permalink
Browse files

More cleanup

  • Loading branch information...
bipthelin committed Nov 14, 2012
1 parent 8b6fc53 commit 242ad567f1e112beb094871c146227f317bbe511
Showing with 51 additions and 18 deletions.
  1. +25 −0 README.md
  2. +0 −18 priv/app.config
  3. +26 −0 rebar.tests.config
View
@@ -64,6 +64,31 @@ users, clients and tokens. Instead, it provides a proxy module (`oauth2_backend`
calls to a backend plugin supplied by you. To direct calls to a different backend module,
simply set `{backend, your_backend_module}` in the `oauth2` section of your app.config.
+The following example demonstrates a basic app.config section for oauth2.
+
+``` erlang
+[
+ {oauth2, [
+ %% Default expiry_time for access_tokens unless
+ %% overridden per flow
+ {expiry_time, 3600}
+ ,{backend, backend_goes_here}
+
+ %% Optional expiry_time override per flow
+ ,{password_credentials, [
+ {expiry_time, 7200}
+ ]}
+ ,{client_credentials, [
+ {expiry_time, 86400}
+ ]}
+ ,{code_grant, [
+ %% Recommended absolute expiry time from the spec
+ {expiry_time, 600}
+ ]}
+ ]}
+].
+```
+
A complete list of functions that your backend must provide is available by looking
at `oauth2_backend.erl`, which contains documentation and function specifications.
View
@@ -1,18 +0,0 @@
-[
- {oauth2, [
- {expiry_time, 3600}
- ,{backend, backend_goes_here}
-
- %% Optional expiry_time override per flow
- ,{password_credentials, [
- {expiry_time, 7200}
- ]}
- ,{client_credentials, [
- {expiry_time, 86400}
- ]}
- ,{code_grant, [
- %% Recommended absolute expiry time from the spec
- {expiry_time, 600}
- ]}
- ]}
-].
View
@@ -1,3 +1,29 @@
+%% ----------------------------------------------------------------------------
+%%
+%% oauth2: Erlang OAuth 2.0 implementation
+%%
+%% Copyright (c) 2012 KIVRA
+%%
+%% Permission is hereby granted, free of charge, to any person obtaining a
+%% copy of this software and associated documentation files (the "Software"),
+%% to deal in the Software without restriction, including without limitation
+%% the rights to use, copy, modify, merge, publish, distribute, sublicense,
+%% and/or sell copies of the Software, and to permit persons to whom the
+%% Software is furnished to do so, subject to the following conditions:
+%%
+%% The above copyright notice and this permission notice shall be included in
+%% all copies or substantial portions of the Software.
+%%
+%% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+%% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+%% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+%% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+%% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+%% FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+%% DEALINGS IN THE SOFTWARE.
+%%
+%% ----------------------------------------------------------------------------
+
{deps, [{meck, ".*", {git, "https://github.com/eproxus/meck.git", {tag, "0.7.2"}}}]}.
{clean_files, [".eunit", "ebin/*.beam", "test/*.beam"]}.

0 comments on commit 242ad56

Please sign in to comment.