Skip to content

Instantly share code, notes, and snippets.

View winster's full-sized avatar

winster winster

View GitHub Profile

This gist describes the configuration required for Spring reactive WebClient to make a call to an OAuth2 protected resource through OAuth2.0 Client Credentials Grant Type Flow.

Assumption is that the Authorization Server supports OpenId Connect 1.0 specifications.

@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active June 15, 2024 00:55
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
#!/bin/bash
# Download and build libcurl, openssl and zlib for Android using Crystax NDK r7
# Must be run on 32 bit Linux as the Crystax r7 NDK doesn't support 64 bit hosts
# Tested on Ubuntu 14.04
# Make the working directory
mkdir curl-android-build
cd curl-android-build
ROOT_DIR=`pwd -P`
@pcan
pcan / SelfExpiringHashMap.java
Last active April 21, 2024 14:18
SelfExpiringHashMap - a Java Map which entries expire automatically after a given time; it uses a DelayQueue internally.
/*
* Copyright (c) 2019 Pierantonio Cangianiello
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is