-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implicit grant. Needs CORS filter running on UAA.
- Loading branch information
Will Tran
authored and
Rob Gallagher
committed
Jan 21, 2015
1 parent
fb5cfba
commit 139e57e
Showing
7 changed files
with
69 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
45 changes: 45 additions & 0 deletions
45
samples/oauth-showcase/src/main/resources/public/implicit.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!DOCTYPE HTML> | ||
<html xmlns:th="http://www.thymeleaf.org"> | ||
<head> | ||
<title>OAuth 2 Showcase</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | ||
<style type="text/css"> | ||
table, th, td { | ||
border: 1px solid black; | ||
border-spacing: 0; | ||
} | ||
</style> | ||
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | ||
<script type="text/javascript"> | ||
$(function(){ | ||
var fullTokenBase64 = /access_token=([^&]+)/.exec(window.location.hash)[1]; | ||
var tokenBase64 = fullTokenBase64.split('\.')[1]; | ||
var tokenJsonString = atob(tokenBase64); | ||
var prettyToken = JSON.stringify(JSON.parse(tokenJsonString),null,' '); | ||
$('#token').text(prettyToken); | ||
|
||
$.ajax('http://localhost:8080/uaa/userinfo',{ | ||
headers:{ | ||
"Authorization": "Bearer "+fullTokenBase64 | ||
}, | ||
success: function(data) { | ||
var prettyUserinfo = JSON.stringify(data,null,' '); | ||
$('#userinfo').text(prettyUserinfo); | ||
} | ||
}); | ||
|
||
|
||
}); | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<h1>OAuth 2 Showcase!!!!!!!!!!!!111</h1> | ||
<p>This is a static HTML page! The server only saw a request for /implicit.html. Everything after the # in the address bar is stuff that only your browser can see.</p> | ||
<p>Here's the result of calling /userinfo:</p> | ||
<pre id="userinfo"></pre> | ||
<p>Your access token is:</p> | ||
<pre id="token"></pre> | ||
|
||
</body> | ||
</html> |
This file contains 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
This file contains 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
This file contains 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