diff --git a/AspNet.Security.OAuth.Providers.sln b/AspNet.Security.OAuth.Providers.sln index 6c017accf..9a1857c37 100644 --- a/AspNet.Security.OAuth.Providers.sln +++ b/AspNet.Security.OAuth.Providers.sln @@ -221,6 +221,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{C2CA4B38-A docs\workweixin.md = docs\workweixin.md docs\xumm.md = docs\xumm.md docs\zendesk.md = docs\zendesk.md + docs\miro.md = docs\miro.md docs\linear.md = docs\linear.md EndProjectSection EndProject @@ -319,6 +320,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspNet.Security.OAuth.GitCo EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspNet.Security.OAuth.Atlassian", "src\AspNet.Security.OAuth.Atlassian\AspNet.Security.OAuth.Atlassian.csproj", "{D2110C1B-6FE1-4D9A-81ED-93FB2AC85049}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspNet.Security.OAuth.Miro", "src\AspNet.Security.OAuth.Miro\AspNet.Security.OAuth.Miro.csproj", "{7F22DE22-FDE8-4A14-AA65-D5B36098533E}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AspNet.Security.OAuth.Linear", "src\AspNet.Security.OAuth.Linear\AspNet.Security.OAuth.Linear.csproj", "{B1167108-CA36-4C6B-85B0-1C7F5A24E4A4}" EndProject Global @@ -743,6 +746,10 @@ Global {D2110C1B-6FE1-4D9A-81ED-93FB2AC85049}.Debug|Any CPU.Build.0 = Debug|Any CPU {D2110C1B-6FE1-4D9A-81ED-93FB2AC85049}.Release|Any CPU.ActiveCfg = Release|Any CPU {D2110C1B-6FE1-4D9A-81ED-93FB2AC85049}.Release|Any CPU.Build.0 = Release|Any CPU + {7F22DE22-FDE8-4A14-AA65-D5B36098533E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7F22DE22-FDE8-4A14-AA65-D5B36098533E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7F22DE22-FDE8-4A14-AA65-D5B36098533E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7F22DE22-FDE8-4A14-AA65-D5B36098533E}.Release|Any CPU.Build.0 = Release|Any CPU {B1167108-CA36-4C6B-85B0-1C7F5A24E4A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B1167108-CA36-4C6B-85B0-1C7F5A24E4A4}.Debug|Any CPU.Build.0 = Debug|Any CPU {B1167108-CA36-4C6B-85B0-1C7F5A24E4A4}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -862,6 +869,7 @@ Global {F3E62C24-5F82-4CF5-A994-0E10D04FB495} = {C1352FD3-AE8B-43EE-B45B-F6E0B3FBAC6D} {668833D5-DB6A-475F-B0FD-A03462B037B8} = {C1352FD3-AE8B-43EE-B45B-F6E0B3FBAC6D} {D2110C1B-6FE1-4D9A-81ED-93FB2AC85049} = {C1352FD3-AE8B-43EE-B45B-F6E0B3FBAC6D} + {7F22DE22-FDE8-4A14-AA65-D5B36098533E} = {C1352FD3-AE8B-43EE-B45B-F6E0B3FBAC6D} {B1167108-CA36-4C6B-85B0-1C7F5A24E4A4} = {C1352FD3-AE8B-43EE-B45B-F6E0B3FBAC6D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/README.md b/README.md index a51067286..cc87cc2ad 100644 --- a/README.md +++ b/README.md @@ -205,6 +205,7 @@ If a provider you're looking for does not exist, consider making a PR to add one | LinkedIn | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.LinkedIn?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.LinkedIn/ "Download AspNet.Security.OAuth.LinkedIn from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.LinkedIn?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.LinkedIn "Download AspNet.Security.OAuth.LinkedIn from MyGet.org") | [Documentation](https://docs.microsoft.com/en-us/linkedin/shared/authentication/authentication "LinkedIn developer documentation") | | MailChimp | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.MailChimp?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.MailChimp/ "Download AspNet.Security.OAuth.MailChimp from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.MailChimp?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.MailChimp "Download AspNet.Security.OAuth.MailChimp from MyGet.org") | [Documentation](https://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-oauth2/ "MailChimp developer documentation") | | MailRu | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.MailRu?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.MailRu/ "Download AspNet.Security.OAuth.MailRu from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.MailRu?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.MailRu "Download AspNet.Security.OAuth.MailRu from MyGet.org") | [Documentation](https://o2.mail.ru/docs#web "MailRu developer documentation") | +| Miro | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.Miro?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.Miro/ "Download AspNet.Security.OAuth.Miro from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.Miro?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Miro "Download AspNet.Security.OAuth.Miro from MyGet.org") | [Documentation](https://developers.miro.com/docs/getting-started-with-oauth "Miro developer documentation") | | Mixcloud | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.Mixcloud?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.Mixcloud/ "Download AspNet.Security.OAuth.Mixcloud from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.Mixcloud?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Mixcloud "Download AspNet.Security.OAuth.Mixcloud from MyGet.org") | [Documentation](https://www.mixcloud.com/developers/#authorization "Mixcloud developer documentation") | | Moodle | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.Moodle?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.Moodle/ "Download AspNet.Security.OAuth.Moodle from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.Moodle?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Moodle "Download AspNet.Security.OAuth.Moodle from MyGet.org") | [Documentation](https://github.com/HIT-ReFreSH/moodle-local_oauth "Moodle OAuth2 plugin developer documentation") | | Myob | [![NuGet](https://img.shields.io/nuget/v/AspNet.Security.OAuth.Myob?logo=nuget&label=NuGet&color=blue)](https://www.nuget.org/packages/AspNet.Security.OAuth.Myob/ "Download AspNet.Security.OAuth.Myob from NuGet.org") | [![MyGet](https://img.shields.io/myget/aspnet-contrib/vpre/AspNet.Security.OAuth.Myob?logo=nuget&label=MyGet&color=blue)](https://www.myget.org/feed/aspnet-contrib/package/nuget/AspNet.Security.OAuth.Myob "Download AspNet.Security.OAuth.Myob from MyGet.org") | [Documentation](https://developer.myob.com/api/accountright/api-overview/authentication/ "Myob developer documentation") | diff --git a/docs/README.md b/docs/README.md index cef9dffa2..76ba7d4da 100644 --- a/docs/README.md +++ b/docs/README.md @@ -61,6 +61,7 @@ covered by the section above. | Line | _Optional_ | [Documentation](line.md "Line provider documentation") | | Linear | _Optional_ | [Documentation](linear.md "Linear provider documentation") | | LinkedIn | _Optional_ | [Documentation](linkedin.md "LinkedIn provider documentation") | +| Miro | _Optional_ | [Documentation](miro.md "Miro provider documentation") | | Odnoklassniki | _Optional_ | [Documentation](odnoklassniki.md "Odnoklassniki provider documentation") | | Okta | **Required** | [Documentation](okta.md "Okta provider documentation") | | Patreon | _Optional_ | [Documentation](patreon.md "Patreon provider documentation") | diff --git a/docs/miro.md b/docs/miro.md new file mode 100644 index 000000000..bc2fd31f3 --- /dev/null +++ b/docs/miro.md @@ -0,0 +1,25 @@ +# Integrating the Miro Provider + +## Example + +```csharp +services.AddAuthentication(options => /* Auth configuration */) + .AddMiro(options => + { + options.ClientId = configuration["Miro:ClientId"] ?? string.Empty; + options.ClientSecret = configuration["Miro:ClientSecret"] ?? string.Empty; + }) +``` + +## Required Additional Settings + +_None._ + +## Optional Settings + +_None._ + +## Retrieving the user's email address + +The Miro provider does not return the user's email address, since the API endpoints to do that is available only on the Miro Enterprise plan. If you are on the Miro Enterprise plan, you can use the access token returned by the authentication flow to retrieve the user's email address yourself by following the Miro documentation for [getting the user info and email](https://developers.miro.com/docs/get-user-info-and-email). + diff --git a/src/AspNet.Security.OAuth.Miro/AspNet.Security.OAuth.Miro.csproj b/src/AspNet.Security.OAuth.Miro/AspNet.Security.OAuth.Miro.csproj new file mode 100644 index 000000000..7ab0a791a --- /dev/null +++ b/src/AspNet.Security.OAuth.Miro/AspNet.Security.OAuth.Miro.csproj @@ -0,0 +1,21 @@ + + + + 9.2.0 + + true + $(DefaultNetCoreTargetFramework) + + + + ASP.NET Core security middleware enabling Miro authentication. + Jerrie Pelser + aspnetcore;authentication;miro;oauth;security + + + + + + + + diff --git a/src/AspNet.Security.OAuth.Miro/MiroAuthenticationConstants.cs b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationConstants.cs new file mode 100644 index 000000000..532d7f08a --- /dev/null +++ b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationConstants.cs @@ -0,0 +1,24 @@ +/* + * Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) + * See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers + * for more information concerning the license and the contributors participating to this project. + */ + +namespace AspNet.Security.OAuth.Miro; + +/// +/// Contains constants specific to the . +/// +public static class MiroAuthenticationConstants +{ + public static class Claims + { + public const string OrganizationId = "urn:miro:organization_id"; + + public const string OrganizationName = "urn:miro:organization_name"; + + public const string TeamId = "urn:miro:team_id"; + + public const string TeamName = "urn:miro:team_name"; + } +} diff --git a/src/AspNet.Security.OAuth.Miro/MiroAuthenticationDefaults.cs b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationDefaults.cs new file mode 100644 index 000000000..c8a2ff520 --- /dev/null +++ b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationDefaults.cs @@ -0,0 +1,48 @@ +/* + * Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) + * See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers + * for more information concerning the license and the contributors participating to this project. + */ + +namespace AspNet.Security.OAuth.Miro; + +/// +/// Default values used by the Miro authentication middleware. +/// +public class MiroAuthenticationDefaults +{ + /// + /// Default value for . + /// + public const string AuthenticationScheme = "Miro"; + + /// + /// Default value for . + /// + public static readonly string DisplayName = "Miro"; + + /// + /// Default value for . + /// + public static readonly string Issuer = "Miro"; + + /// + /// Default value for . + /// + public static readonly string CallbackPath = "/signin-miro"; + + /// + /// Default value for . + /// + public static readonly string AuthorizationEndpoint = "https://miro.com/oauth/authorize"; + + /// + /// Default value for . + /// + public static readonly string TokenEndpointFormat = "https://api.miro.com/v1/oauth/token"; + + /// + /// Default value . + /// + public static readonly string UserInformationEndpoint = "https://api.miro.com/v1/oauth-token"; +} diff --git a/src/AspNet.Security.OAuth.Miro/MiroAuthenticationExtensions.cs b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationExtensions.cs new file mode 100644 index 000000000..1a940531f --- /dev/null +++ b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationExtensions.cs @@ -0,0 +1,71 @@ +/* + * Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) + * See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers + * for more information concerning the license and the contributors participating to this project. + */ + +using AspNet.Security.OAuth.Miro; + +namespace Microsoft.Extensions.DependencyInjection; + +public static class MiroAuthenticationExtensions +{ + /// + /// Adds to the specified + /// , which enables Miro authentication capabilities. + /// + /// The authentication builder. + /// A reference to this instance after the operation has completed. + public static AuthenticationBuilder AddMiro([NotNull] this AuthenticationBuilder builder) + { + return builder.AddMiro(MiroAuthenticationDefaults.AuthenticationScheme, options => { }); + } + + /// + /// Adds to the specified + /// , which enables Miro authentication capabilities. + /// + /// The authentication builder. + /// The delegate used to configure the Miro authentication options. + /// A reference to this instance after the operation has completed. + public static AuthenticationBuilder AddMiro( + [NotNull] this AuthenticationBuilder builder, + [NotNull] Action configuration) + { + return builder.AddMiro(MiroAuthenticationDefaults.AuthenticationScheme, configuration); + } + + /// + /// Adds to the specified + /// , which enables Miro authentication capabilities. + /// + /// The authentication builder. + /// The authentication scheme associated with this instance. + /// The delegate used to configure the Miro authentication options. + /// The . + public static AuthenticationBuilder AddMiro( + [NotNull] this AuthenticationBuilder builder, + [NotNull] string scheme, + [NotNull] Action configuration) + { + return builder.AddMiro(scheme, MiroAuthenticationDefaults.DisplayName, configuration); + } + + /// + /// Adds to the specified + /// , which enables Miro authentication capabilities. + /// + /// The authentication builder. + /// The authentication scheme associated with this instance. + /// The optional display name associated with this instance. + /// The delegate used to configure the Miro authentication options. + /// The . + public static AuthenticationBuilder AddMiro( + [NotNull] this AuthenticationBuilder builder, + [NotNull] string scheme, + [NotNull] string caption, + [NotNull] Action configuration) + { + return builder.AddOAuth(scheme, caption, configuration); + } +} diff --git a/src/AspNet.Security.OAuth.Miro/MiroAuthenticationHandler.cs b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationHandler.cs new file mode 100644 index 000000000..e5a896d27 --- /dev/null +++ b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationHandler.cs @@ -0,0 +1,68 @@ +/* + * Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) + * See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers + * for more information concerning the license and the contributors participating to this project. + */ + +using System.Net.Http.Headers; +using System.Security.Claims; +using System.Text.Encodings.Web; +using System.Text.Json; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace AspNet.Security.OAuth.Miro; + +public partial class MiroAuthenticationHandler( + [NotNull] IOptionsMonitor options, + [NotNull] ILoggerFactory logger, + [NotNull] UrlEncoder encoder) + : OAuthHandler(options, logger, encoder) +{ + protected override async Task CreateTicketAsync( + [NotNull] ClaimsIdentity identity, + [NotNull] AuthenticationProperties properties, + [NotNull] OAuthTokenResponse tokens) + { + using var request = new HttpRequestMessage(HttpMethod.Get, Options.UserInformationEndpoint); + request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", tokens.AccessToken); + + using var response = await Backchannel.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, Context.RequestAborted); + if (!response.IsSuccessStatusCode) + { + await Log.UserProfileErrorAsync(Logger, response, Context.RequestAborted); + throw new HttpRequestException("An error occurred while retrieving the user profile from Miro."); + } + + using var payload = JsonDocument.Parse(await response.Content.ReadAsStringAsync(Context.RequestAborted)); + + var principal = new ClaimsPrincipal(identity); + var context = new OAuthCreatingTicketContext(principal, properties, Context, Scheme, Options, Backchannel, tokens, payload.RootElement); + context.RunClaimActions(); + + await Events.CreatingTicket(context); + return new AuthenticationTicket(context.Principal!, context.Properties, Scheme.Name); + } + + private static partial class Log + { + internal static async Task UserProfileErrorAsync(ILogger logger, HttpResponseMessage response, CancellationToken cancellationToken) + { + UserProfileError( + logger, + response.StatusCode, + response.Headers.ToString(), + await response.Content.ReadAsStringAsync(cancellationToken)); + } + + [LoggerMessage(1, + LogLevel.Error, + "An error occurred while retrieving the user profile: the remote server returned a {Status} response with the following payload: {Headers} {Body}.")] + private static partial void UserProfileError( + ILogger logger, + System.Net.HttpStatusCode status, + string headers, + string body); + } +} diff --git a/src/AspNet.Security.OAuth.Miro/MiroAuthenticationOptions.cs b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationOptions.cs new file mode 100644 index 000000000..a04dfa5bc --- /dev/null +++ b/src/AspNet.Security.OAuth.Miro/MiroAuthenticationOptions.cs @@ -0,0 +1,30 @@ +/* + * Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) + * See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers + * for more information concerning the license and the contributors participating to this project. + */ + +using System.Security.Claims; +using static AspNet.Security.OAuth.Miro.MiroAuthenticationConstants; + +namespace AspNet.Security.OAuth.Miro; + +public class MiroAuthenticationOptions : OAuthOptions +{ + public MiroAuthenticationOptions() + { + ClaimsIssuer = MiroAuthenticationDefaults.Issuer; + CallbackPath = MiroAuthenticationDefaults.CallbackPath; + + AuthorizationEndpoint = MiroAuthenticationDefaults.AuthorizationEndpoint; + TokenEndpoint = MiroAuthenticationDefaults.TokenEndpointFormat; + UserInformationEndpoint = MiroAuthenticationDefaults.UserInformationEndpoint; + + ClaimActions.MapJsonSubKey(ClaimTypes.NameIdentifier, "user", "id"); + ClaimActions.MapJsonSubKey(ClaimTypes.Name, "user", "name"); + ClaimActions.MapJsonSubKey(Claims.OrganizationId, "organization", "id"); + ClaimActions.MapJsonSubKey(Claims.OrganizationName, "organization", "name"); + ClaimActions.MapJsonSubKey(Claims.TeamId, "team", "id"); + ClaimActions.MapJsonSubKey(Claims.TeamName, "team", "name"); + } +} diff --git a/test/AspNet.Security.OAuth.Providers.Tests/Miro/MiroTests.cs b/test/AspNet.Security.OAuth.Providers.Tests/Miro/MiroTests.cs new file mode 100644 index 000000000..7bf050ebb --- /dev/null +++ b/test/AspNet.Security.OAuth.Providers.Tests/Miro/MiroTests.cs @@ -0,0 +1,27 @@ +/* + * Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) + * See https://github.com/aspnet-contrib/AspNet.Security.OAuth.Providers + * for more information concerning the license and the contributors participating to this project. + */ + +namespace AspNet.Security.OAuth.Miro; + +public class MiroTests(ITestOutputHelper outputHelper) : OAuthTests(outputHelper) +{ + public override string DefaultScheme => MiroAuthenticationDefaults.AuthenticationScheme; + + protected internal override void RegisterAuthentication(AuthenticationBuilder builder) + { + builder.AddMiro(options => ConfigureDefaults(builder, options)); + } + + [Theory] + [InlineData(ClaimTypes.NameIdentifier, "the-user-id")] + [InlineData(ClaimTypes.Name, "John Wick")] + [InlineData(MiroAuthenticationConstants.Claims.OrganizationId, "the-organization-id")] + [InlineData(MiroAuthenticationConstants.Claims.OrganizationName, "Continental Services")] + [InlineData(MiroAuthenticationConstants.Claims.TeamId, "the-team-id")] + [InlineData(MiroAuthenticationConstants.Claims.TeamName, "Baba Yaga Unit")] + public async Task Can_Sign_In_Using_Miro(string claimType, string claimValue) + => await AuthenticateUserAndAssertClaimValue(claimType, claimValue); +} diff --git a/test/AspNet.Security.OAuth.Providers.Tests/Miro/bundle.json b/test/AspNet.Security.OAuth.Providers.Tests/Miro/bundle.json new file mode 100644 index 000000000..b3a59fab0 --- /dev/null +++ b/test/AspNet.Security.OAuth.Providers.Tests/Miro/bundle.json @@ -0,0 +1,44 @@ +{ + "$schema": "https://raw.githubusercontent.com/justeat/httpclient-interception/master/src/HttpClientInterception/Bundles/http-request-bundle-schema.json", + "items": [ + { + "comment": "https://developers.miro.com/docs/getting-started-with-oauth#step-2-exchange-authorization-code-for-an-access-token", + "uri": "https://api.miro.com/v1/oauth/token", + "method": "POST", + "contentFormat": "json", + "contentJson": { + "access_token": "secret-access-token", + "token_type": "bearer", + "scope": "repo,gist" + } + }, + { + "uri": "https://api.miro.com/v1/oauth-token", + "contentFormat": "json", + "contentJson": { + "type" : "oAuthToken", + "createdBy" : { + "type" : "user", + "name" : "John Wick", + "id" : "the-user-id" + }, + "team" : { + "type" : "team", + "name" : "Baba Yaga Unit", + "id" : "the-team-id" + }, + "scopes" : [ "boards:read" ], + "organization" : { + "type" : "organization", + "name" : "Continental Services", + "id" : "the-organization-id" + }, + "user" : { + "type" : "user", + "name" : "John Wick", + "id" : "the-user-id" + } + } + } + ] +}