Skip to content

Commit 97aa8c8

Browse files
authored
Merge pull request #822 from DuendeSoftware/mb/fix-is4-feedback
Update IS4 to DISv7 upgrade guide with new API changes and example adjustments
2 parents ae1aa1c + aace187 commit 97aa8c8

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

src/content/docs/identityserver/upgrades/identityserver4-to-duende-identityserver-v7.mdx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,23 @@ If you have not made customizations to the IdentityServer UI templates, consider
9191

9292
A couple of compilation errors and required changes you may encounter:
9393

94-
- The `IIdentityServerInteractionService.GetAllUserConsentsAsync` method was renamed to `IIdentityServerInteractionService.GetAllUserGrantsAsync`
95-
- `ConsentResponse.Denied` was removed. Use the `DenyAuthorizationAsync` instead:
94+
* When configuring scopes in memory, you need to register the scopes on startup.
95+
96+
```diff lang="csharp" title="Program.cs"
97+
builder.Services.AddIdentityServer()
98+
.AddInMemory...
99+
+ .AddInMemoryApiScopes(Config.ApiScopes)
100+
```
101+
102+
* The `IIdentityServerInteractionService.GetAllUserConsentsAsync` method was renamed to `IIdentityServerInteractionService.GetAllUserGrantsAsync`
103+
* `ConsentResponse.Denied` was removed. Use the `DenyAuthorizationAsync` instead:
96104

97105
```diff lang="csharp" title="*.cs"
98106
- await _interaction.GrantConsentAsync(context, ConsentResponse.Denied);
99107
+ await _interaction.DenyAuthorizationAsync(context, AuthorizationError.AccessDenied);
100108
```
101109

102-
- No overload method `SignInAsync` takes N arguments. The `HttpContext.SignInAsync` signature changed:
110+
* No overload method `SignInAsync` takes N arguments. The `HttpContext.SignInAsync` signature changed:
103111

104112
```diff lang="csharp" title="*.cs"
105113
// issue authentication cookie with subject ID and username
@@ -109,7 +117,7 @@ A couple of compilation errors and required changes you may encounter:
109117
+ DisplayName = user.Username
110118
+ };
111119
+
112-
+ await HttpContext.SignInAsync(isuser);
120+
+ await HttpContext.SignInAsync(isuser, props);
113121
```
114122

115123
* `AuthorizationRequest` doesn't contain definition for `ClientId`:

0 commit comments

Comments
 (0)