Skip to content

Instantly share code, notes, and snippets.

View mraible's full-sized avatar

Matt Raible mraible

View GitHub Profile
@mraible
mraible / HomeController.java
Created January 16, 2020 20:59
Spring Security OIDC Demo
@RestController
class HomeController {
@GetMapping("/")
public String hello(@AuthenticationPrincipal OidcUser user) {
return "Hello, " + user.getFullName();
}
}
@mraible
mraible / search.component.spec.ts
Created November 10, 2019 09:09
Unit Test in Angular 9
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { SearchComponent } from './search.component';
import { MockSearchService } from '../shared/search/mocks/search.service.mock';
import { MockActivatedRoute } from '../shared/search/mocks/routes';
import { SearchService } from '../shared';
import { ActivatedRoute } from '@angular/router';
import { FormsModule } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';
@mraible
mraible / 10m-2.16.0.html
Last active February 5, 2024 10:16
Add Authentication to Any Web Page in 10 Minutes
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
<title>Simple Web Page</title>
<style>
h1 {
margin: 2em 0;
@mraible
mraible / tour.md
Last active September 13, 2019 23:18
Matt Raible's UK + Ireland JUG Tour 2019
2019-04-14 14:23:21.362 9919-9962/com.okta.developer D/NetworkSecurityConfig: No Network Security Config specified, using platform default
2019-04-14 14:23:21.540 9919-9994/com.okta.developer V/Capacitor/Plugin: To native (Cordova plugin): callbackId: SecureStorage1589709940, service: SecureStorage, action: init, actionArgs: ["SecretStore"]
2019-04-14 14:23:21.541 9919-9994/com.okta.developer E/SecureStorage: Device is not secure
2019-04-14 14:23:21.545 9919-9994/com.okta.developer V/Capacitor/Plugin: To native (Capacitor plugin): callbackId: 23778496, pluginId: Browser, methodName: open
2019-04-14 14:23:21.545 9919-9994/com.okta.developer V/Capacitor: callback: 23778496, pluginId: Browser, methodName: open, methodData: {"url":"https:\/\/dev-737523.oktapreview.com\/oauth2\/default\/v1\/authorize?redirect_uri=com.okta.developer%3A%2Fcallback&client_id=0oak8qpmhim2MmwF20h7&response_type=code&state=hfYUg5lbP5&scope=openid%20profile%20offline_access&code_challenge=K4jgoVyT7ckRpar6rZ2AfJ9hVY18b3H5IYX38JbMtsg&code_
@mraible
mraible / application.yml
Created January 10, 2019 00:28
Get an ID Token from Okta with Spring Boot
okta:
oauth2:
issuer: https://{yourOktaDomain}/oauth2/default
client-id: {clientId}
client-secret: {clientSecret}
@mraible
mraible / init.lua
Last active June 17, 2021 17:29
My Hammerspoon init.lua
units = {
right30 = { x = 0.70, y = 0.00, w = 0.30, h = 1.00 },
right70 = { x = 0.30, y = 0.00, w = 0.70, h = 1.00 },
left70 = { x = 0.00, y = 0.00, w = 0.70, h = 1.00 },
left30 = { x = 0.00, y = 0.00, w = 0.30, h = 1.00 },
top50 = { x = 0.00, y = 0.00, w = 1.00, h = 0.50 },
bot50 = { x = 0.00, y = 0.50, w = 1.00, h = 0.50 },
upright30 = { x = 0.70, y = 0.00, w = 0.30, h = 0.50 },
botright30 = { x = 0.70, y = 0.50, w = 0.30, h = 0.50 },
upleft70 = { x = 0.00, y = 0.00, w = 0.70, h = 0.50 },
@mraible
mraible / apps.jh
Last active December 16, 2021 22:30
Microservices with JHipster and Import JDL
application {
config {
baseName gateway,
packageName com.okta.developer.gateway,
applicationType gateway,
authenticationType oauth2,
prodDatabaseType postgresql,
searchEngine elasticsearch,
serviceDiscoveryType eureka,
testFrameworks [protractor]
@mraible
mraible / server.log
Created August 20, 2018 21:33
Spring Boot 2.1.0.M1 and Spring Security 5.1.0.RC1 Resource Server w/o client secret
2018-08-20 15:12:22.992 WARN 2203 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfiguration': Unsatisfied dependency expressed through method 'setContentNegotationStrategy' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.OAuth2ClientConfiguration$OAuth2ClientWebMvcSecurityConfiguration': Unsatisfied dependency expressed through method 'setClientRegistrationRepository'
@mraible
mraible / spring.log
Created July 18, 2018 17:35
Spring Security 5.1 Issuer Error
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityConfiguration': Unsatisfied dependency expressed through method 'setContentNegotationStrategy' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration': Unsatisfied dependency expressed through method 'setConfigurers' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.OAuth2ClientConfiguration$OAuth2ClientWebMvcSecurityConfiguration': Unsatisfied dependency expressed through method 'setAuthorizedClientService' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'authorizedClientService' defined in class path resource