var atoken;
$.ajax({
url: "<c:url value = '/api/oauth/token' />",
type: 'POST',
crossDomain: true,
async: false,
cache: false,
data: {
grant_type:'password',
username:'admin',
password:'admin'
},
success: function(token, status) {
//store.set('token', token);
atoken=token;
},
beforeSend: function (xhr) {
xhr.setRequestHeader ("Authorization", "Basic " + btoa("acme:acmesecret" ));
}
[Read More]
localStorage JSON
when set and get json in localStorage will add this type
var authToken = JSON.parse(localStorage.getItem("authenticationToken"));
localStorage.setItem("authenticationToken",JSON.stringify( token));
spring security oauth2 change default prefix path
when add oauth to your project oauth library create some endpoint for get token .get authorize code ,get refresh token and some other oauth protocol this endpoint has rest url s in this url Mapped "{[/oauth/authorize]} Mapped "{[/oauth/token],methods=[GET]}" Mapped "{[/oauth/check_token]}" ,.. when your project run in...
[Read More]
handle nvl in postgres
CREATE OR REPLACE FUNCTION nvl(expr1 text, expr2 text)
RETURNS text AS
$BODY$
SELECT coalesce($1, $2);
$BODY$
LANGUAGE sql;
[Read More]