Created
October 1, 2014 15:13
-
-
Save mgonto/436501d13bc577b02907 to your computer and use it in GitHub Desktop.
Angular
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = new Request(); | |
request.url = bla; | |
// Header sent automatically | |
request.make(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
authProvider.init({ | |
clientId, | |
clientSecret, | |
domain, | |
offline_mode: true | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth.signin({}, function success(profile, id_token, ) { | |
// Tokens are magically saved for you in localStorage | |
}, function error(err) { | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auth.refreshToken(function(newIdToken) { | |
// Use the new one | |
auth.idToken = newIdToken; | |
}); | |
// Automatically refreshed for you if expired and you try to do an operation |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment