.well-known => _apis
This commit is contained in:
parent
3d9d7b00d7
commit
e7ffe06d9d
43
README.md
43
README.md
|
@ -29,8 +29,7 @@ If you have no idea what you're doing
|
|||
4. Download [oauth3.js-v1.zip](https://git.oauth3.org/OAuth3/oauth3.js/repository/archive.zip?ref=v1)
|
||||
5. Double-click to unzip the folder.
|
||||
6. Copy the file `oauth3.core.js` into the folder `example.com/assets/oauth3.org/`
|
||||
7. Copy the folder `well-known` into the folder `example.com/`
|
||||
8. Rename the folder `well-known` to `.well-known` (when you do this, it become invisible, that's okay)
|
||||
7. Copy the folder `_apis` into the folder `example.com/`
|
||||
9. Add `<script src="assets/oauth3.org/oauth3.core.js"></script>` to your `index.html`
|
||||
9. Add `<script src="app.js"></script>` to your `index.html`
|
||||
10. Create files in `example.com` called `app.js` and `index.html` and put this in it:
|
||||
|
@ -144,13 +143,13 @@ it might look like this:
|
|||
example.com
|
||||
│
|
||||
│
|
||||
├── .well-known (hidden)
|
||||
│ └── oauth3
|
||||
├── _apis
|
||||
│ └── oauth3.org
|
||||
│ ├── callback.html
|
||||
│ ├── directives.json
|
||||
│ └── index.html
|
||||
├── assets
|
||||
│ └── org.oauth3
|
||||
│ └── oauth3.org
|
||||
│ └── oauth3.core.js
|
||||
│
|
||||
│
|
||||
|
@ -171,17 +170,17 @@ Installation (if you know what you're doing)
|
|||
pushd /path/to/your/web/app
|
||||
|
||||
|
||||
# clone the project as assets/org.oauth3
|
||||
# clone the project as assets/oauth3.org
|
||||
mkdir -p assets
|
||||
git clone git@git.oauth3.org:OAuth3/oauth3.js.git assets/org.oauth3
|
||||
pushd assets/org.oauth3
|
||||
git clone git@git.oauth3.org:OAuth3/oauth3.js.git assets/oauth3.org
|
||||
pushd assets/oauth3.org
|
||||
git checkout v1
|
||||
popd
|
||||
|
||||
|
||||
# symlink `.well-known/oauth3` to `assets/org.oauth3/.well-known/oauth3`
|
||||
mkdir -p .well-known
|
||||
ln -sf ../assets/org.oauth3/.well-known/oauth3 .well-known/oauth3
|
||||
# symlink `_apis/oauth3.org` to `assets/oauth3.org/_apis/oauth3.org`
|
||||
mkdir -p _apis
|
||||
ln -sf ../assets/oauth3.org/_apis/oauth3 _apis/oauth3.org
|
||||
```
|
||||
|
||||
**Advanced Installation with `bower`**
|
||||
|
@ -191,17 +190,17 @@ ln -sf ../assets/org.oauth3/.well-known/oauth3 .well-known/oauth3
|
|||
bower install oauth3
|
||||
|
||||
|
||||
# create a `.well-known` folder and an `assets` folder
|
||||
mkdir -p .well-known assets
|
||||
# create a `_apis` folder and an `assets` folder
|
||||
mkdir -p _apis assets
|
||||
|
||||
|
||||
# symlink `.well-known/oauth3` to `bower_components/oauth3/.well-known/oauth3`
|
||||
ln -sf ../bower_components/oauth3/.well-known/oauth3 .well-known/oauth3
|
||||
# symlink `_apis/oauth3.org` to `bower_components/oauth3.org/_apis/oauth3.org`
|
||||
ln -sf ../bower_components/oauth3.org/_apis/oauth3.org _apis/oauth3.org
|
||||
|
||||
|
||||
# symlink `assets/org.oauth3` to `bower_components/oauth3`
|
||||
ln -sf ../bower_components/oauth3/.well-known/oauth3 .well-known/oauth3
|
||||
ln -sf ../bower_components/oauth3 assets/org.oauth3
|
||||
# symlink `assets/oauth3.org` to `bower_components/oauth3.org`
|
||||
ln -sf ../bower_components/oauth3.org/_apis/oauth3.org _apis/oauth3.org
|
||||
ln -sf ../bower_components/oauth3.org assets/oauth3.org
|
||||
```
|
||||
|
||||
Usage
|
||||
|
@ -210,7 +209,7 @@ Usage
|
|||
Update your HTML to include the the following script tag:
|
||||
|
||||
```html
|
||||
<script src="assets/org.oauth3/oauth3.core.js"></script>
|
||||
<script src="assets/oauth3.org/oauth3.core.js"></script>
|
||||
```
|
||||
|
||||
You can create a very simple demo application like this:
|
||||
|
@ -289,7 +288,7 @@ You're all set. Nothing else is needed.
|
|||
We've created an `Oauth3` service just for you:
|
||||
|
||||
```html
|
||||
<script src="assets/org.oauth3/oauth3.ng.js"></script>
|
||||
<script src="assets/oauth3.org/oauth3.ng.js"></script>
|
||||
```
|
||||
|
||||
```js
|
||||
|
@ -322,7 +321,7 @@ promise = oauth3.init(opts); // set and fetch your own si
|
|||
// promises your site's config // opts = { location, session, issuer, audience }
|
||||
|
||||
promise = oauth3.setIdentityProvider(url); // changes the Identity Provider URI (the site you're logging into),
|
||||
// promises the provider's config // gets the config for that site (from their .well-known/oauth3),
|
||||
// promises the provider's config // gets the config for that site (from their _apis/oauth3.org),
|
||||
// and caches it in internal state as the default
|
||||
|
||||
promise = oauth3.setResourceProvider(url); // changes the Resource Provider URI (the site you're getting stuff from)
|
||||
|
@ -497,5 +496,5 @@ can be very ugly and confusing and we definitely need to allow relative paths.
|
|||
|
||||
A potential work-around would be to assume all paths are relative (eliminate #4 instead)
|
||||
and have the path always key off of the base URL - if oauth3 directives are to be found at
|
||||
https://example.com/username/.well-known/oauth3/directives.json then /api/whatever would refer
|
||||
https://example.com/username/_apis/oauth3.org/index.json then /api/whatever would refer
|
||||
to https://example.com/username/api/whatever.
|
||||
|
|
Loading…
Reference in New Issue