-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'latest' into chore/kinesis-fips-doc-update
- Loading branch information
Showing
155 changed files
with
5,420 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
oauth2-provider/1.0/modules/ROOT/pages/oauth2-provider-module-reference.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: oauth2-provider-module | ||
version: '1.1' | ||
display_version: 1.1 (Mule 4) | ||
title: OAuth2 Provider Module | ||
nav: | ||
- modules/ROOT/nav.adoc | ||
asciidoc: | ||
attributes: | ||
page-component-desc: Allows a Mule runtime engine (Mule) app to be configured as an Authentication Manager in an OAuth2 dance. | ||
page-connector-type: Module | ||
page-connector-level: Select | ||
page-exchange-group-id: com.mulesoft.modules | ||
page-exchange-asset-id: mule-oauth2-provider-module | ||
page-runtime-version: 4.1.1 | ||
page-release-notes-page: release-notes::connector/oauth2-provider-release-notes.adoc |
Binary file added
BIN
+348 KB
oauth2-provider/1.1/modules/ROOT/image-source-files/oauth2-provider-example.graffle
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.xref:index.adoc[OAuth2 Provider Module] | ||
* xref:index.adoc[OAuth2 Provider Module Overview] | ||
* xref:oauth2-provider-module-reference.adoc[OAuth2 Provider Module Reference] | ||
* xref:oauth2-provider-module-troubleshooting.adoc[Troubleshooting OAuth2 Provider Module] | ||
* xref:oauth2-provider-xml-maven.adoc[OAuth2 Provider Module XML and Maven Support] | ||
* xref:oauth2-provider-module-example.adoc[OAuth2 Provider Module Examples] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
= OAuth2 Provider Module - Mule 4 | ||
|
||
OAuth2 Provider Module v1.1 | ||
|
||
The OAuth2 Provider module enables a Mule runtime engine (Mule) app to be configured as an Authentication Manager in an OAuth2 dance. | ||
With this role, the application can authenticate to previously registered clients, grant tokens, validate tokens, or register and delete clients, all during the execution of a flow. | ||
|
||
The following documentation assumes a basic knowledge of the OAuth2 authorization protocol. For further reference, see the https://tools.ietf.org/html/rfc6749[RFC-6749]. | ||
|
||
If the app behaves as the client in the OAuth2 dance, use the xref:oauth-module::index.adoc[OAuth Module] instead. | ||
|
||
|
||
== Before You Begin | ||
|
||
To use this module, you must be familiar with: | ||
|
||
* Anypoint Connectors | ||
* Mule runtime engine (Mule) | ||
* Elements and global elements in a Mule flow | ||
* Creating a Mule app using Anypoint Studio (Studio) | ||
|
||
== Using Exchange Templates and Examples | ||
|
||
https://www.mulesoft.com/exchange/[Anypoint Exchange] provides templates | ||
that you can use as starting points for your apps and examples that illustrate a complete solution. | ||
|
||
|
||
== See Also | ||
|
||
* xref:connectors::introduction/introduction-to-anypoint-connectors.adoc[Introduction to Anypoint Connectors] | ||
* xref:connectors::introduction/intro-use-exchange.adoc[Use Exchange to Discover Connectors, Templates, and Examples] | ||
* https://help.mulesoft.com[MuleSoft Help Center] |
114 changes: 114 additions & 0 deletions
114
oauth2-provider/1.1/modules/ROOT/pages/oauth2-provider-module-example.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
= OAuth2 Provider Module Example | ||
|
||
The OAuth2 Provider module supports a Mule runtime engine (Mule) application to be configured as an Authentication Manager in an OAuth2 authorization framework. | ||
By using this module, the application can register clients, authenticate registered clients, grant tokens, validate tokens, and delete clients. | ||
The following example shows how to configure the *Create client* and *Validate token* operations, that create and validate client credentials. | ||
|
||
image::oauth2-provider-example.png[OAuth provider studio flow] | ||
|
||
. In Studio, drag the HTTP *Listener* operation to the Studio canvas. | ||
. Set *Path* to `/createClient`. | ||
. Set the *Connector configuration* to your desired HTTP configuration. | ||
. Drag the *Create client* operation alongside the HTTP *Listener* operation. | ||
. Set *Module configuration* to your desired OAuth2 provider module configuration. | ||
. Set the following parameters: + | ||
* *Client id*: `attributes.headers.client_id` + | ||
* *Type*: `CONFIDENTIAL` + | ||
* *Secret*: `attributes.headers.client_secret` + | ||
* *Client name*: `attributes.headers.client_name` + | ||
* *Description*: `””` + | ||
* *Principal*: `””` + | ||
* *Redirect uris*: `”demo.com”` + | ||
* *Authorized grant types*: `”CLIENT_CREDENTIALS”` + | ||
[start=7] | ||
. Drag a *Set Payload* component alongside the *Create client* operation. | ||
. Set *Value* to `Client Created`. | ||
. Drag a new HTTP *Listener* source to a new flow. | ||
. Set *Path* to `/validate`. | ||
. Drag a *Validate token* operation alongside the *Listener* source. | ||
. Set *Module configuration* to your desired OAuth2 provider module configuration. | ||
. Set *Access token* to `(attributes.headers['authorization'] splitBy ' ')[1]`. | ||
. Drag a *Transform Message* component alongside the *Validate token* operation. | ||
. In the output display, add the following DataWeave code: | ||
+ | ||
[source,dataweave,linenums] | ||
----- | ||
%dw 2.0 | ||
output application/json | ||
--- | ||
{ | ||
"Message": "Successfully validated" | ||
} | ||
----- | ||
[start=16] | ||
. Save and run your Mule app. | ||
|
||
== Test your Mule App | ||
|
||
To test the Mule app, run the following commands: | ||
|
||
`http://oauthtest01.us-e2.cloudhub.io/createClient` | ||
Method: GET | ||
Param: client_id, client_secret, client_name | ||
|
||
For example, setting the GET parameters fields with the following values `client_id = 123`, `client_secret = 1234`, `client_name = abc` | ||
|
||
Returns the following result: | ||
|
||
[source,xml,linenums] | ||
---- | ||
{ | ||
"Message": "Client Created" | ||
} | ||
---- | ||
|
||
`http://oauthtest01.us-e2.cloudhub.io/token` | ||
Method: POST | ||
Param: client_id, client_secret, grant_type | ||
|
||
For example, setting the POST parameters fields with the following values: `client_id = 123`, `client_secret = 1234`, `grant_type = CLIENT_CREDENTIALS` | ||
|
||
Returns the following result: | ||
|
||
[source,xml,linenums] | ||
---- | ||
{"access_token":"s143Barj7xpQP3_AGWvHRyZxFNEcgJ55XB1I3Yquj8kgem2qxqa5TpouLG3gQCr2sj170Ci1MqLd5gzF4AUpRQ", | ||
"token_type":"Bearer", | ||
"expires_in":86400} | ||
---- | ||
|
||
Another option is to run the validate command: | ||
`http://oauthtest01.us-e2.cloudhub.io/validate` | ||
Method: GET | ||
Param: Authorization | ||
|
||
. Put the `token_type` received from the response data which is "Bearer". | ||
. Add a space. | ||
. Add the `access_token` received from the response data. | ||
|
||
For example, the Authorization equals to the Bearer: | ||
|
||
[source,xml,linenums] | ||
---- | ||
Bearer s143Barj7xpQP3_AGWvHRyZxFNEcgJ55XB1I3Yquj8kgem2qxqa5TpouLG3gQCr2sj170Ci1MqLd5gzF4AUpRQ | ||
---- | ||
|
||
Returns the following result: | ||
|
||
[source,xml,linenums] | ||
---- | ||
{ | ||
"Message": "Successfully validated" | ||
} | ||
---- | ||
|
||
If the response is not valid, the result is the following: | ||
|
||
[source,xml,linenums] | ||
---- | ||
The token received: s143BarjxpQP3_AGWvHRyZxFNEcgJ55XB1I3Yquj8kgem2qxqa5TpouLG3gQCr2sj170Ci1MqLd5gzF4AUpRQ, is not valid. | ||
---- | ||
|
||
== See Also | ||
|
||
* https://help.mulesoft.com[MuleSoft Help Center] |
Oops, something went wrong.