Skip to content

Instantly share code, notes, and snippets.

Avatar

Nov Matake nov

View GitHub Profile
View my-second-powershell-script.ps1
$client_id = "<YOUR-CLIENT-ID>"
$client_secret = "<YOUR-CLIENT-SECRET>"
$redirect_uri = "<YOUR-CALLBACK-URL>"
$authz_endpoint = "https://graph.facebook.com/oauth/authorize"
$token_endpoint = "https://graph.facebook.com/oauth/token"
open ($authz_endpoint + "?client_id=" + $client_id + "&redirect_uri=" + $redirect_uri)
$code = Read-Host "code"
View my-first-powershell-script.ps1
$access_token = "<YOUR-TOKEN-HERE>"
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "Bearer $access_token")
$response = Invoke-RestMethod 'https://graph.facebook.com/me' -Headers $headers
"$response"
View jwk_generation.js
var pem = '-----BEGIN PUBLIC KEY-----\
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApnOaAemDtELggT4BpfuE\
PDImzKZpEX/U8MNSk5RF/j8LGR5V8CjN1ASO0Yy9HxILpTDZFFVEsCVKo4c/Smi6\
PzMlNIyywrpnAJFoqtuSLlD/A8SRBEgyXRWzEwvtfW5fhmGFVLw9qm5ZDgrL/XNW\
gMH4uHvJA1mdQlRyCopUlvAeQJ2aM13rNpkYRnCQIDNfVStEsVbYTjF0m9QR1Nb1\
zYpzB4nDNVQlZmj+SyDwtY+BMH6GAiXwa8JOb0mHgUVnxdWdL6lx8kVUkg16Yv17\
D8u0Jhl+7W1SVVVNEYaGKaB1KKmJ7twibmyX4gwBRbQIamvHyZRc/BBaCg3YZNxh\
pwIDAQAB\
-----END PUBLIC KEY-----';
View gist:fe855e487a9c11fa501aca92fd492bfc
git clone git@github.com:openid-foundation-japan/800-63-3.git
cd 800-63-3
git checkout gh-branch
bundle install
jekyll server
View auto_kid_handling.rb
require 'json/jwt' # v1.6.2+
private_key = OpenSSL::PKey::RSA.generate(2048)
jwk = JSON::JWK.new(private_key)
p jwk[:kid] # => auto-generated kid (= JWK Thumbprint value)
jwt = JSON::JWT.new(
iss: 'https://idp.example.com',
aud: 'https://rp.example.com',
View adfs_for_hybrid_app.rb
require 'openid_connect'
OpenIDConnect.debug!
config = OpenIDConnect::Discovery::Provider::Config.discover! 'https://sts.example.com/adfs'
client = OpenIDConnect::Client.new(
identifier: '2940bc16-983c-41ca-b373-4c6045278627', # Native App's client_id
redirect_uri: 'custom-schema://foobar',
authorization_endpoint: config.authorization_endpoint,
View id_token_as_jwt_bearer_assertion.rb
require 'rack/oauth2'
require 'json/jwt'
require 'webmock'
Rack::OAuth2.debug!
include WebMock::API
WebMock.disable_net_connect!
id_token = JSON::JWT.new(
View sample_id_token_for_token_exchange.rb
require 'json/jwt'
rsa_key = OpenSSL::PKey::RSA.new <<-PEM
:
PEM
claims = {
iss: 'https://auth.server.example.com',
sub: 'user-98765',
aud: [
View keynote-client.diff
diff --git a/lib/keynote/slide.rb b/lib/keynote/slide.rb
index fea1fc2..6af486f 100644
--- a/lib/keynote/slide.rb
+++ b/lib/keynote/slide.rb
@@ -28,7 +28,6 @@ module Keynote
end
def title=(title)
- title = title.gsub(/(\r\n|\r|\n)/) { '\\n' }
@title = title
View gist:20b5d0561f04f73ba984
https://www.facebook.com/v2.5/dialog/oauth?
app_id=685543434893182&
client_id=685543434893182&
display=popup&
domain=209a.jp.vonvon.me&
e2e=%7B%7D&
locale=ja_JP&
origin=1&
redirect_uri=http%3A%2F%2Fstatic.ak.facebook.com%2Fconnect%2Fxd_arbiter...&
response_type=token%2Csigned_request&
You can’t perform that action at this time.