Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(polling-registry) Add BASIC & OAuth2 client auth support for HTTP/HTTPS file loading. #531

Merged
merged 8 commits into from Feb 7, 2017

Conversation

msavy
Copy link
Member

@msavy msavy commented Feb 4, 2017

  • Add BASIC & OAuth2 client auth support for HTTP/HTTPS file loading.

  • Refactor for improved extensibility, with assumption additional auth methods will be added later.

@msavy msavy added the WIP label Feb 4, 2017
@msavy
Copy link
Member Author

msavy commented Feb 4, 2017

Example of using HTTP with BASIC auth:

  "registry": {
      "class": "io.apiman.gateway.engine.vertx.polling.URILoadingRegistry",
      "config": {
          "configUri": "https://gist.githubusercontent.com/msavy/cb245f4ed5228e8aa368a03b035f4b9b/raw/25dcc614dba43821b7623e16302b404c39bdeeca/apiman-gateway-api.json",
          "auth": "basic",
          "username": "foo",
          "password": "bar"
      }
  },

Might change the layout a bit, but you get the gist.

Example with OAuth2:

  "registry": {
      "class": "io.apiman.gateway.engine.vertx.polling.URILoadingRegistry",
      "config": {
          "configUri": "https://gist.githubusercontent.com/msavy/cb245f4ed5228e8aa368a03b035f4b9b/raw/25dcc614dba43821b7623e16302b404c39bdeeca/apiman-gateway-api.json",
          "auth": "OAuth2Client",
          "flowType": "password",
          "oauthUri": "http://localhost:8080/auth",
          "tokenPath": "/realms/apiman/protocol/openid-connect/token",
          "clientID": "apiman",
          "clientSecret": "5af5458f-0a96-4251-8f92-08ebcc3a8aa2",  
          "username": "admin",
          "password": "admin123!"
      }
  },

@msavy msavy force-pushed the vertx-polling-client-auth-refactor-rb branch from a8ff82e to 2ea2488 Compare February 4, 2017 22:34
@msavy
Copy link
Member Author

msavy commented Feb 7, 2017

Also added:

Keycloak-specific support via pmlopes's super-awesome Vert.x OAuth2 Client. Just paste the Keycloak OIDC JSON from the "installation" section in your KC client.

  "registry": {
  	"class": "io.apiman.gateway.engine.vertx.polling.URILoadingRegistry",
  	"config": {
  		"configUri": "https://gist.githubusercontent.com/msavy/cb245f4ed5228e8aa368a03b035f4b9b/raw/25dcc614dba43821b7623e16302b404c39bdeeca/apiman-gateway-api.json",
  		"realm": "apiman",
  		"realm-public-key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxyG61ohrfJQKNmDA/ePZtqZVpPXjwn3k3T+iWiTvMsxW2+WlnqIEmL5qZ09DMhBH9r50WZRO2gVoCb657Er9x0vfD6GNf/47XU2y33TX8axhP+hSwkv/VViaDlu4jQrfgPWz/FXMjWIZxg1xQS+nOBF2ScCRYWNQ/ZnUNnvrq8dGC2/AlyeYcgDUOdwlJuvgkGlF0QoVPQiRPurR3RwlG+BjL8JB3hbaAZhdJqwqApmGQbcpgLj2tODnlrZnEAp5cPPU/lgqCE1OOp78BAEiE91ZLPl/+D8qDHk+Maz0Io3bkeRZMXPpvtbL3qN+3GlF8Yz264HDSsTNrH+nd19tFQIDAQAB",
  		"auth-server-url": "http://localhost:8080/auth",
  		"ssl-required": "none",
  		"resource": "apiman",
  		"credentials": {
  			"secret": "5af5458f-0a96-4251-8f92-08ebcc3a8aa2"
  		},
  		"username": "admin",
  		"password": "admin123!",
  		"auth": "KeycloakOAuth2Client",
  		"flowType": "password"
  	}
  }

…P/HTTPS file loading.

* Refactor for improved extensibility, with assumption additional auth methods
  will be added later.
* refactor Make some OAuth2 code shared.

* refactor Use new initialisation code.

* refactor Better error handling.
@msavy msavy force-pushed the vertx-polling-client-auth-refactor-rb branch from 5b7ea07 to 777c6f4 Compare February 7, 2017 14:44
@msavy msavy merged commit be975cb into apiman:master Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant