All Projects → imduffy15 → token-cli

imduffy15 / token-cli

Licence: Apache-2.0 license
Command line utility for interacting with OAuth2 infrastructure to generate tokens

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to token-cli

Hydra
OpenID Certified™ OpenID Connect and OAuth Provider written in Go - cloud native, security-first, open source API security for your infrastructure. SDKs for any language. Compatible with MITREid.
Stars: ✭ 11,884 (+62447.37%)
Mutual labels:  identity, authorization, sso, oidc
Product Is
Welcome to the WSO2 Identity Server source code! For info on working with the WSO2 Identity Server repository and contributing code, click the link below.
Stars: ✭ 435 (+2189.47%)
Mutual labels:  identity, authorization, sso
authentik
The authentication glue you need.
Stars: ✭ 2,941 (+15378.95%)
Mutual labels:  authorization, sso, oidc
OpenAM
OpenAM is an open access management solution that includes Authentication, SSO, Authorization, Federation, Entitlements and Web Services Security.
Stars: ✭ 476 (+2405.26%)
Mutual labels:  authorization, sso, oidc
casdoor
An Identity and Access Management (IAM) / Single-Sign-On (SSO) platform with web UI supporting OAuth 2.0, OIDC, SAML and CAS, QQ group: 645200447
Stars: ✭ 4,147 (+21726.32%)
Mutual labels:  sso, oidc, authn
Oauthlib
A generic, spec-compliant, thorough implementation of the OAuth request-signing logic
Stars: ✭ 2,323 (+12126.32%)
Mutual labels:  identity, authorization, oidc
beyondauth
a traefik / nginx companion to create an identity aware proxy like beyondcorp
Stars: ✭ 26 (+36.84%)
Mutual labels:  identity, authorization
logto
🧑‍🚀 Logto helps you build the sign-in, auth, and user identity within minutes. We provide an OIDC-based identity service and the end-user experience with username, phone number, email, and social sign-in, with extendable multi-language support.
Stars: ✭ 3,421 (+17905.26%)
Mutual labels:  identity, authorization
auth0-xamarin-oidc-samples
Auth0 OIDC Client with Xamarin applications
Stars: ✭ 26 (+36.84%)
Mutual labels:  identity, oidc
Aspnet5identityserverangularimplicitflow
OpenID Connect Code / Implicit Flow with Angular and ASP.NET Core 5 IdentityServer4
Stars: ✭ 670 (+3426.32%)
Mutual labels:  identity, authorization
Xxl Sso
A distributed single-sign-on framework.(分布式单点登录框架XXL-SSO)
Stars: ✭ 1,635 (+8505.26%)
Mutual labels:  authorization, sso
Spring Boot Security Saml Sample
SBS3 — A sample SAML 2.0 Service Provider built on Spring Boot.
Stars: ✭ 469 (+2368.42%)
Mutual labels:  identity, sso
ms-identity-javascript-tutorial
A chapterwise tutorial that will take you through the fundamentals of modern authentication with Microsoft identity platform in Vanilla JavaScript.
Stars: ✭ 100 (+426.32%)
Mutual labels:  authorization, oidc
Stormpath Sdk Java
Official Java SDK for the Stormpath User Management REST API
Stars: ✭ 221 (+1063.16%)
Mutual labels:  identity, authorization
AspNetCoreBackChannelLogout
ASP.NET Core Back-Channel Logout for Hybrid Clients, Redis, Key Vault, Azure
Stars: ✭ 17 (-10.53%)
Mutual labels:  identity, oidc
Express Mongodb Rest Api Boilerplate
A boilerplate for Node.js apps / Rest API / Authentication from scratch - express, mongodb (mongoose).
Stars: ✭ 153 (+705.26%)
Mutual labels:  authorization, token
Doorkeeper
Doorkeeper is an OAuth 2 provider for Ruby on Rails / Grape.
Stars: ✭ 4,917 (+25778.95%)
Mutual labels:  identity, authorization
Zitadel
ZITADEL - Cloud Native Identity and Access Management
Stars: ✭ 105 (+452.63%)
Mutual labels:  identity, sso
Cipheridaas
CipherIDaaS —— Open-source IDaaS/IAM product by CipherChina , Hangzhou .
Stars: ✭ 121 (+536.84%)
Mutual labels:  identity, sso
Casbin
An authorization library that supports access control models like ACL, RBAC, ABAC in Golang
Stars: ✭ 10,872 (+57121.05%)
Mutual labels:  authorization, authz

GitHub license GitHub release

TokenCLI

tokenCLI is a command line utility for generating tokens from a OpenID identity provider, such as Keycloak.

tokenCLI uses the Authorization Code Grant Flow, as such a refresh token is generated and used to automatically renew the access token without browser interaction.

token-cli - The OpenID token generator

Installation

OSX

Install:

brew install imduffy15/tap/token-cli

Upgrade:

brew upgrade token-cli

Alternative Installs (tar.gz, RPM, deb, snap)

Check out the releases section on Github for alternative binaries.

Contribute

Fork token-cli and build a custom version. We welcome any useful pull requests.

Usage

Create a new target called example-realm:

$ token-cli target create example-realm -t http://localhost:8080/auth/realms/example-realm/.well-known/openid-configuration

Set example-realm as the active target:

$ token-cli target set example-realm

Get a token for the client "service-template" with redirection port 9090

$ token-cli token get service-template -p 9090

Examples

Google

Add Google as a target and set it as the active target

$ token-cli target create google --openid-configuration-url https://accounts.google.com/.well-known/openid-configuration
$ token-cli target set google

Generate a token for client-id 571394967398-j6vs98u325la013f0ho6hehosdi2h2eb.apps.googleusercontent.com with scope openid

$ token-cli token get 571394967398-j6vs98u325la013f0ho6hehosdi2h2eb.apps.googleusercontent.com --scope openid

You can register Google clients at https://console.cloud.google.com/apis/credentials

Microsoft

Add Microsoft as a target and set it as the active target

$ token-cli target create microsoft --openid-configuration-url https://login.microsoftonline.com/common/v2.0/.well-known/openid-configuration
$ token-cli target set microsoft

Generate a token for client-id b9951982-9e22-4bb8-8632-436f47b030f4

$ token-cli token get b9951982-9e22-4bb8-8632-436f47b030f4 --client_secret '[email protected][4LH2mRs@/bH'

You can register Microsoft clients at https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps , this target is for (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox) authorization only.

Azure AD

Add Azure AD as a target, where 960a630a-dab4-4fd9-a048-88eddede726d is my tenant id and set it as the active target

$ token-cli target create azure --openid-configuration-url https://login.microsoftonline.com/960a630a-dab4-4fd9-a048-88eddede726d/v2.0/.well-known/openid-configuration
$ token-cli target set azure

Generate a token for client-id 90a49166-df3b-46a9-bb20-155f4055ef83

$ token-cli token get 90a49166-df3b-46a9-bb20-155f4055ef83 --client_secret 'pGw]yxRb:fww-fk?X2uskpfSPlHXV559'

You can register Azure AD clients at https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps , this target is for (Default Directory only - Single tenant) authorization only.

Okta

Add Okta as a target and set it as the active target

$ token-cli target create okta --openid-configuration-url https://dev-351390-admin.oktapreview.com/.well-known/openid-configuration
$ token-cli target set okta

Generate a token for client-id 0oaodg6in82hvS2uV0h7

$ token-cli token get 0oaodg6in82hvS2uV0h7 --client_secret '8XojWRVjegSMh8hzmZZ-NIq-9ur6fauRDPk-Rv-k'

You can register OKTA clients in your personal dashboard at https://TENANT-ID-admin.oktapreview.com/admin/apps/active , where tenant-id is your tenant id.

Instagram

Add Instagram as as target and set it as the active target

$ token-cli target create instagram --token-url https://api.instagram.com/oauth/access_token --authorization-url https://api.instagram.com/oauth/authorize
$ token-cli target set instagram

Generate a token for client-id c3b3514c9a614b53b6f393b7dc3f7459

$ token-cli token get c3b3514c9a614b53b6f393b7dc3f7459 --client_secret 4dfdef8221284c2480c8d71cea00d0b2  --scope basic

You can register Instagram clients at https://www.instagram.com/developer/clients/manage/

Strava

$ token-cli target create strava --token-url https://www.strava.com/oauth/token --authorizaion-url http://www.strava.com/oauth/authorize
$ token-cli target set strava

Generate a token for client-id 40638

token-cli token get 40638 --client_secret e36b1089bfe26c8010cd10eabe419c96493c412b --scope read

You can register Strava clients at https://www.strava.com/settings/api

Help

$ token-cli --help
Token Command Line Interface, version

Usage:
  token-cli [command]

Available Commands:
  help        Help about any command
  target      Configure and view OIDC targets
  token       Configure and view tokens

Flags:
  -h, --help      help for token-cli
  -v, --verbose   See additional info on HTTP requests

Use "token-cli [command] --help" for more information about a command.
$ token-cli target --help
Configure and view OIDC targets

Usage:
  token-cli target [flags]
  token-cli target [command]

Available Commands:
  create      Creates a new target
  delete      Delete the target named TARGET_NAME
  get         View the target named TARGET_NAME
  list        List all targets
  set         sets TARGET_NAME as active

Flags:
  -h, --help                  help for target
  -k, --skip-ssl-validation   Disable security validation on requests to this target

Global Flags:
  -v, --verbose   See additional info on HTTP requests

Use "token-cli target [command] --help" for more information about a command.
$ token-cli token --help
Configure and view tokens

Usage:
  token-cli token [command]

Available Commands:
  get         Obtain a token for the specified CLIENT_ID

Flags:
  -h, --help   help for token

Global Flags:
  -v, --verbose   See additional info on HTTP requests

Use "token-cli token [command] --help" for more information about a command.

License

Apache License 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].