Skip to content

Instantly share code, notes, and snippets.

View zamd's full-sized avatar

Zulfiqar Ahmed zamd

View GitHub Profile
@zamd
zamd / dotnetcore2.md
Last active September 28, 2017 09:41
dotnet core 2 exploration

dot core 2.0 exploration

Runtime

This repo has runtime packages for various environments etc. This is bit deeper than the public facing download link at dot.net, which includes both SDK and runtimes...

Each runtime package is made up of 3 primary parts:

@zamd
zamd / cname-dynamic-client.md
Last active October 4, 2017 06:24
Dynamic Client lock customisation for cname

Lock needs tenant/domain level connection information and when cname is enabled lock seems to hit info-v1 endpoint...

Have to override the assetsUrl to correct tenant url manually...

    var customDomain = config.authorizationServer.url.replace('https://', '');
    config.cdn = "https://cdn.au.auth0.com"
    var tenant = config.auth0Domain.split('.')[0];
    config.assetsUrl = config.cdn + "/tenants/v1/" + tenant + ".js";
az storage blob copy start -u "https://appbuildstorage.blob.core.windows.net/releases/p-release-13130.vhd?sv=SAS-TOKEN" -c vhds -b p-release-13130.vhd --account-name zulfiqar --account-key ACNT-KEY
az storage blob show -c vhds -n p-release-13130.vhd  --account-name zulfiqar --account-key KEYa-=====
  • Create a volume to mount host director into container

docker volume create --driver local --opt device=/Users/zamd/tmp2/dotnetdev --opt type=none --opt o=bind devnet

  • Start dotnet container with host directory

docker run -itd -v dotnetdev:/app e1a56dca783e

@zamd
zamd / landing_page.md
Last active January 26, 2019 01:05
Selecting landing page via Auth0

Auth0 offers passing extra whitelisted params to upstream IdPs. This feature can be used to pass initial screen/page hint to the upstream IdP.

  • PATCH the custom oauth connection to whitelist and alias the upstream param
curl -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IlFqVTVRVEpEUmpnd09UUXpOVGxFUlVZeFJURTRNams0TVRFMlFUUkVNVGxGTlRsRE5VWXlRUSJ9." -X PATCH  -H "Content-Type: application/json" -d '{"options":{"upstream_params":{"initial_page":{"alias":"login_hint"}}}}' "https://{domain}.auth0.com/api/v2/connections/{id}"
  • You can now pass intial page as standard login_hint value and auth0 would translate this to the configured outgoing parameter.
@zamd
zamd / azure-ad-evolution.md
Last active July 2, 2019 07:28
Azure ad endpoint evolution notes

Azure AD OAuth/OIDC evolution

  • The v2 endpoints are renamed to Microsoft Identity Platform and should be preferred integration route for new apps. They are fully OAuth2/OIDC compliant.

  • The common endpoint can be used for multi-tenant apps, which can sign-in users with personal accounts and/or multiples ad directories

https://login.microsoftonline.com/common/oauth2/v2.0/authorize
  • The above endpoint will serve login page where you can sign in with all microsoft identities (personal, school, work)
@zamd
zamd / mod_sts.md
Last active October 7, 2019 14:18
Instructions to compile and install mod_sts

Using mod_sts with upcoming Auth0 token-exchange feature

compile and install instructions

mod_sts allows you to setup Apache as an API gateway. There is currently no built in binaries available. The following instructions can be used to build and install this module in Apache on Ubuntu 18.

Install base tools