Skip to content

Instantly share code, notes, and snippets.

View Robinyo's full-sized avatar

Rob Ferguson Robinyo

View GitHub Profile
@Robinyo
Robinyo / AuthNController.java
Created January 9, 2022 20:37
Private Key JWT Client Authentication
package au.gov.dta.rp.controller;
import au.gov.dta.rp.model.TokenResponse;
import au.gov.dta.rp.service.AuthNService;
import com.nimbusds.jwt.JWT;
import com.nimbusds.jwt.JWTClaimsSet;
import com.nimbusds.jwt.JWTParser;
import com.nimbusds.jwt.SignedJWT;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
package org.robferguson.resteasy.examples.helloworld;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import org.robferguson.resteasy.examples.helloworld.resource.MessageResource;
@ApplicationPath("")
package org.robferguson.resteasy.examples.helloworld.resource;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@Path("/hello")
'use strict';
/*
* Dependency Injection Syntax and AngularJS
* The notation that we have used is one of the two ways in which we can declare AngularJS controllers
* (or services, directives, or filters). The style we have used, which is also the recommended way,
* is the safe-style of Dependency Injection, or declaration.
*/
angular.module('vardyger')
'use strict';
angular.module('vardyger')
.factory('AuthenticationService',
function(
$log, // inject the $log service
$rootScope, // inject the $rootScope service
$http, // inject the $http service
authService, // inject the authService service
localStorageService // inject the localStorageService service
@Robinyo
Robinyo / app.js
Last active August 29, 2015 14:25
Setting up the application's routes
...
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: '/app',
templateUrl: 'templates/side-menu-template.html',
controller: 'SideMenuController',
abstract: true