Skip to content

Commit b54d62e

Browse files
updating translations on quickstarts
1 parent 3e20d2e commit b54d62e

File tree

585 files changed

+22828
-14108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

585 files changed

+22828
-14108
lines changed

articles/quickstart/backend/acul/interactive.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ locale: en-US
1414
# Build a Login ID screen using ACUL
1515

1616

17-
<p></p>
17+
<p>`</p>
1818

1919
## Configure Auth0
2020

2121

2222
<p>To use Auth0 services, you’ll need to have an application set up in the Auth0 Dashboard. The Auth0 application is where you will configure how you want authentication to work for the project you are developing.</p><h3>Configure an application</h3><p>Use the interactive selector to create a new Auth0 application or select an existing application that represents the project you want to integrate with. Every application in Auth0 is assigned an alphanumeric, unique client ID that your application code will use to call Auth0 APIs through the SDK.</p><p>Any settings you configure using this quickstart will automatically update for your Application in the <a href="https://manage.auth0.com/#/">Dashboard</a>, which is where you can manage your Applications in the future.</p><p>If you would rather explore a complete configuration, you can view a sample application instead.</p><h3>Configure Callback URLs</h3><p>A callback URL is a URL in your application that you would like Auth0 to redirect users to after they have authenticated. If not set, users will not be returned to your application after they log in.</p><p><div class="alert-container" severity="default"><p>If you are following along with our sample project, set this to <code>http://localhost:3000</code>.</p></div></p><h3>Configure Logout URLs</h3><p>A logout URL is a URL in your application that you would like Auth0 to redirect users to after they have logged out. If not set, users will not be able to log out from your application and will receive an error.</p><p><div class="alert-container" severity="default"><p>If you are following along with our sample project, set this to <code>http://localhost:3000</code>.</p></div></p><h3>Configure Allowed Web Origins</h3><p>An Allowed Web Origin is a URL that you want to be allowed to access to your authentication flow. This must contain the URL of your project. If not properly set, your project will be unable to silently refresh authentication tokens, so your users will be logged out the next time they visit your application or refresh a page.</p><p><div class="alert-container" severity="default"><p>If you are following along with our sample project, set this to <code>http://localhost:3000</code>.</p></div></p>
2323

24-
## Configure ACUL for Login ID screen {{{ data-action="code" data-code="settings.json" }}}
24+
## Configure ACUL for Login ID screen {{{ data-action="code" data-code="settings.json" }}}
2525

2626

2727
<p>Use <a href="https://github.com/auth0/auth0-cli">Auth0 CLI</a> to enable ACLU Login ID screen in your tenant.
@@ -72,7 +72,7 @@ npm install
7272
## Build a custom interface for login-id screen {{{ data-action="code" data-code="index.tsx" }}}
7373

7474

75-
<p>Run a single-page application to build custom login screens. </p><h3>Configure the Boilerplate application</h3><p>1. In the root folder of your project, open a new terminal and clone the Auth0 boilerplate application using the following command:</p><p><pre><code class="language-powershell">git clone https://github.com/auth0-samples/auth0-react-samples
75+
<p>Run a single-page application to build custom login screens. </p><h3>Configure the Boilerplate application</h3><p>1. In the root folder of your project, open a new terminal and clone the Auth0 boilerplate application using the following command:</p><p><pre><code class="language-javascript">git clone https://github.com/auth0-samples/auth0-acul-react-boilerplate
7676

7777
</code></pre>
7878

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: ApiController.cs
3+
language: csharp
4+
---
5+
6+
```csharp
7+
[Route("api")]
8+
public class ApiController : Controller
9+
{
10+
[HttpGet("private")]
11+
[Authorize]
12+
public IActionResult Private()
13+
{
14+
return Ok(new
15+
{
16+
Message = "Hello from a private endpoint!"
17+
});
18+
}
19+
20+
[HttpGet("private-scoped")]
21+
[Authorize("read:messages")]
22+
public IActionResult Scoped()
23+
{
24+
return Ok(new
25+
{
26+
Message = "Hello from a private-scoped endpoint!"
27+
});
28+
}
29+
}
30+
```
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: HasScopeHandler.cs
3+
language: csharp
4+
---
5+
6+
```csharp
7+
public class HasScopeHandler : AuthorizationHandler<HasScopeRequirement>
8+
{
9+
protected override Task HandleRequirementAsync(
10+
AuthorizationHandlerContext context,
11+
HasScopeRequirement requirement
12+
) {
13+
// If user does not have the scope claim, get out of here
14+
if (!context.User.HasClaim(c => c.Type == "scope" && c.Issuer == requirement.Issuer))
15+
return Task.CompletedTask;
16+
17+
// Split the scopes string into an array
18+
var scopes = context.User
19+
.FindFirst(c => c.Type == "scope" && c.Issuer == requirement.Issuer).Value.Split(' ');
20+
21+
// Succeed if the scope array contains the required scope
22+
if (scopes.Any(s => s == requirement.Scope))
23+
context.Succeed(requirement);
24+
25+
return Task.CompletedTask;
26+
}
27+
}
28+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
name: HasScopeRequirement.cs
3+
language: csharp
4+
---
5+
6+
```csharp
7+
public class HasScopeRequirement : IAuthorizationRequirement
8+
{
9+
public string Issuer { get; }
10+
public string Scope { get; }
11+
12+
public HasScopeRequirement(string scope, string issuer)
13+
{
14+
Scope = scope ?? throw new ArgumentNullException(nameof(scope));
15+
Issuer = issuer ?? throw new ArgumentNullException(nameof(issuer));
16+
}
17+
}
18+
```
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Program.cs
3+
language: csharp
4+
---
5+
6+
```csharp
7+
var builder = WebApplication.CreateBuilder(args);
8+
builder.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
9+
.AddJwtBearer(options =>
10+
{
11+
options.Authority = $"https://{builder.Configuration["Auth0:Domain"]}/";
12+
options.Audience = builder.Configuration["Auth0:Audience"];
13+
options.TokenValidationParameters = new TokenValidationParameters
14+
{
15+
NameClaimType = ClaimTypes.NameIdentifier
16+
};
17+
});
18+
19+
builder.Services
20+
.AddAuthorization(options =>
21+
{
22+
options.AddPolicy(
23+
"read:messages",
24+
policy => policy.Requirements.Add(
25+
new HasScopeRequirement("read:messages", domain)
26+
)
27+
);
28+
});
29+
30+
builder.Services.AddSingleton<IAuthorizationHandler, HasScopeHandler>();
31+
32+
var app = builder.Build();
33+
app.UseAuthentication();
34+
app.UseAuthorization();
35+
```

articles/quickstart/backend/aspnet-core-webapi/files/appsettings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: appsettings.json
33
language: json
44
---
5-
5+
66
```json
77
{
88
"Auth0": {

0 commit comments

Comments
 (0)