Skip to content

Commit 980af1c

Browse files
committed
Merge branch 'master' of github.com:auth0/docs
2 parents 14b43d1 + 3b8b2cc commit 980af1c

File tree

12 files changed

+87
-36
lines changed

12 files changed

+87
-36
lines changed

docs/includes/callapi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ You have two options: (a) use the same client id and secret for both your applic
77

88
### <i class="icon icon-html5" style="margin-right: 10px;font-size: 25px;"></i> Single Page Applications / HTML5 JavaScript Front End
99

10-
The `JWT` is available on the location hash of the browser as the `id_token` parameter. You probably want to store it in local/session storage or a cookie `auth0.getProfile(window.location.hash, ...)`. <a href="singlepageapp-tutorial" target="_new">Read more...</a>
10+
The `JWT` is available on the location hash of the browser as the `id_token` parameter. You probably want to store it in local/session storage or a cookie `auth0.getProfile(location.hash, ...)`. <a href="singlepageapp-tutorial" target="_new">Read more...</a>
1111

1212
### <i class="icon icon-mobile-phone" style="margin-right: 10px;font-size: 30px;"></i> Native Mobile Applications
1313

docs/instagram-clientid.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Obtaining a Client ID and Client Secret for Instagram
2+
3+
To configure Instagram OAuth2 connections you will need to register Auth0 with Instagram on their [developer portal](http://developers.instagram.com/).
4+
5+
##1. Log in into the developer portal
6+
Go to the [developer portal](http://instagram.com/developer), and login with your Instagram credentials. Select __Manage Clients__ and click on __Register a New Client__:
7+
8+
![](img/instagram-devportal-1.png)
9+
10+
---
11+
12+
##2. Complete information about your instance of Auth0
13+
14+
Create a new application and complete the form. Use this URL as your callback:
15+
16+
https://@@account.namespace@@/login/callback
17+
18+
![](img/instagram-devportal-2.png)
19+
20+
Enter your new `Client ID` and `Client Secret` into the connection settings in Auth0.
21+

docs/login-widget2.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,14 @@ You can handle the authorization process client-side as follows:
2929
callbackOnLocationHash: true
3030
});
3131

32-
widget.getProfile(window.location.hash, function (err, profile, id_token, access_token, state) {
33-
alert('hello ' + profile.name);
34-
// use id_token to call your rest api
35-
});
36-
32+
var result = widget.parseHash(location.hash);
33+
if (result) {
34+
widget.getProfile(location.hash, function (err, profile, id_token, access_token, state) {
35+
// use profile to access user properties
36+
// use id_token to call your rest api
37+
});
38+
}
39+
3740
function showLoginWidget() {
3841
widget.signin();
3942
}

docs/rules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ A __Rule__ takes the following arguments:
3939
* `clientName`: the name of the application (as defined on the dashboard).
4040
* `connection`: the name of the connection used to authenticate the user (e.g.: `twitter` or `some-google-apps-domain`)
4141
* `connectionStrategy`: the type of connection. For social connection `connectionStrategy` === `connection`. For enterprise connections, the strategy will be `waad` (Windows Azure AD), `ad` (Active Directory/LDAP), `auth0` (database connections), etc.
42-
* `protocol`: the authentication protocol. Possible values: `oidc-basic-profile` (most used, web based login), `oidc-implicit-profile` (used on mobile devices and single page apps), `oauth2-resource-owner` (user/password login typically used on database connections), `samlp` (SAML protocol used on SaaS apps), `wsfed` (Ws-Federation used on Microsoft products like Office365), `wstrust-usernamemixed` (Ws-trust user/password login used on CRM and Office365)).
42+
* `protocol`: the authentication protocol. Possible values: `oidc-basic-profile` (most used, web based login), `oidc-implicit-profile` (used on mobile devices and single page apps), `oauth2-resource-owner` (user/password login typically used on database connections), `samlp` (SAML protocol used on SaaS apps), `wsfed` (WS-Federation used on Microsoft products like Office365), `wstrust-usernamemixed` (WS-trust user/password login used on CRM and Office365), and `delegation` (when calling the [Delegation endpoint](https://docs.auth0.com/auth-api#delegated)).
4343
* `request`: an object containing useful information of the request. It has the following properties:
4444
* `query`: querystring of the login transaction sent by the application
4545
* `body`: the body of the POST request on login transactions used on `oauth2-resource-owner` or `wstrust-usernamemixed` protocols.

docs/scenarios-mqtt.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ This shows how easy it is to use Auth0 in various scenarios. Auth0's user store
214214

215215
> Caveats: it is never a good idea to send credentials (`username`/`password`) over unsecured networks. There are other implementations that provide transport level security that would prevent message contents to be revealed. __mosca__ supports TLS as an example. Likely a production deployment would favor this, unless all traffic happens in a closed network.
216216
217+
###Acknowledgements
218+
Many thanks to [Matteo Collina](http://www.matteocollina.com/) for the review of this article, and for building the awesome __mosca__.
219+
217220

218221

219222

128 KB
Loading
174 KB
Loading

sdk2/snippets/custom.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
});
2626

2727
<% if (callbackOnHash) { %>
28-
// authentication result comes back in `window.location.hash`
29-
widget.getProfile(window.location.hash, function (err, profile, id_token, access_token, state) {
30-
/*
31-
store the profile and id_token in a cookie or local storage
32-
$.cookie('profile', profile);
33-
$.cookie('id_token', id_token);
34-
*/
35-
});
28+
// authentication result comes back in `location.hash`
29+
var result = widget.parseHash(location.hash);
30+
if (result) {
31+
widget.getProfile(location.hash, function (err, profile, id_token, access_token, state) {
32+
// use profile to access user properties
33+
// use id_token to call your rest api
34+
// store them in local storage/cookie
35+
});
36+
}
3637
<% } %>
3738

3839
// sign-in with social provider using a popup (window.open)

sdk2/snippets/embedded.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
callbackURL: '<%= account.callback %>'
1717
});<% } %>
1818
<% if (callbackOnHash) { %>
19-
// authentication result comes back in `window.location.hash`
20-
widget.getProfile(window.location.hash, function (err, profile, id_token, access_token, state) {
21-
/*
22-
store the profile and id_token in a cookie or local storage
23-
$.cookie('profile', profile);
24-
$.cookie('id_token', id_token);
25-
*/
26-
});
19+
// authentication result comes back in `location.hash`
20+
var result = widget.parseHash(location.hash);
21+
if (result) {
22+
widget.getProfile(location.hash, function (err, profile, id_token, access_token, state) {
23+
// use profile to access user properties
24+
// use id_token to call your rest api
25+
// store them in local storage/cookie
26+
});
27+
}
2728
<% } %>
2829

2930
widget.signin({ container: 'root', chrome: true });

sdk2/snippets/login.html

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
callbackURL: '<%= account.callback %>'
1414
});<% } %>
1515
<% if (callbackOnHash) { %>
16-
// authentication result comes back in `window.location.hash`
17-
widget.getProfile(window.location.hash, function (err, profile, id_token, access_token, state) {
18-
/*
19-
store the profile and id_token in a cookie or local storage
20-
$.cookie('profile', profile);
21-
$.cookie('id_token', id_token);
22-
*/
23-
});
16+
// authentication result comes back in `location.hash`
17+
var result = widget.parseHash(location.hash);
18+
if (result) {
19+
widget.getProfile(location.hash, function (err, profile, id_token, access_token, state) {
20+
// use profile to access user properties
21+
// use id_token to call your rest api
22+
// store them in local storage/cookie
23+
});
24+
}
2425
<% } %>
2526
</script>
2627
<button onclick="widget.signin()">Login</button>

0 commit comments

Comments
 (0)