Skip to content

Commit 6dd7f06

Browse files
authored
fix: correct method names in migration guides and README to match v10 API (#887)
1 parent 00513ed commit 6dd7f06

3 files changed

Lines changed: 229 additions & 182 deletions

File tree

MIGRATING.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -90,15 +90,19 @@ await credApi.ChangePasswordAsync(userId, changePasswordRequest);
9090
await credApi.ExpirePasswordAsync(userId);
9191
await credApi.ForgotPasswordAsync(userId, sendEmail);
9292

93-
// OAuth operations moved to UserOAuthApi
93+
// Grant operations moved to UserGrantApi
94+
var grantApi = new UserGrantApi();
95+
var grants = grantApi.ListGrantsForUserAndClient(userId, clientId).ToListAsync();
96+
await grantApi.RevokeGrantsForUserAndClientAsync(userId, clientId);
97+
98+
// OAuth token operations moved to UserOAuthApi
9499
var oauthApi = new UserOAuthApi();
95-
var grants = await oauthApi.ListGrantsForUserAndClient(userId, clientId).ToListAsync();
96-
await oauthApi.RevokeGrantsForUserAndClientAsync(userId, clientId);
100+
var tokens = oauthApi.ListRefreshTokensForUserAndClient(userId, clientId).ToListAsync();
101+
await oauthApi.RevokeTokensForUserAndClientAsync(userId, clientId);
97102

98103
// Session operations moved to UserSessionsApi
99104
var sessionsApi = new UserSessionsApi();
100-
await sessionsApi.ClearUserSessions(userId);
101-
var sessions = await sessionsApi.ListUserSessions(userId).ToListAsync();
105+
await sessionsApi.RevokeUserSessionsAsync(userId);
102106

103107
// Resource operations moved to UserResourcesApi
104108
var resourcesApi = new UserResourcesApi();
@@ -129,16 +133,16 @@ await generalApi.UpdateOrgSettingsAsync(orgSettings);
129133
// Support settings
130134
var supportApi = new OrgSettingSupportApi();
131135
await supportApi.GrantOktaSupportAsync();
132-
await supportApi.GetOktaSupportSettingsAsync();
136+
await supportApi.GetOrgOktaSupportSettingsAsync();
133137

134138
// Contact settings
135139
var contactApi = new OrgSettingContactApi();
136140
await contactApi.GetOrgContactUserAsync(contactType);
137-
await contactApi.UpdateOrgContactUserAsync(contactType, orgContactUser);
141+
await contactApi.ReplaceOrgContactUserAsync(contactType, orgContactUser);
138142

139143
// Communication settings
140144
var commApi = new OrgSettingCommunicationApi();
141-
await commApi.GetOrgCommunicationSettingsAsync();
145+
await commApi.GetOktaCommunicationSettingsAsync();
142146
```
143147

144148
#### RoleApi Changes
@@ -163,23 +167,23 @@ _Now (v10.0.0):_
163167
// User role assignments
164168
var userRoleApi = new RoleAssignmentAUserApi();
165169
await userRoleApi.AssignRoleToUserAsync(userId, assignRoleRequest);
166-
var userRoles = await userRoleApi.ListUserRoles(userId).ToListAsync();
170+
var userRoles = userRoleApi.ListAssignedRolesForUser(userId).ToListAsync();
167171
await userRoleApi.UnassignRoleFromUserAsync(userId, roleId);
168172

169173
// Group role assignments
170174
var groupRoleApi = new RoleAssignmentBGroupApi();
171175
await groupRoleApi.AssignRoleToGroupAsync(groupId, assignRoleRequest);
172-
var groupRoles = await groupRoleApi.ListGroupRoles(groupId).ToListAsync();
176+
var groupRoles = groupRoleApi.ListGroupAssignedRoles(groupId).ToListAsync();
173177

174178
// Group role targets
175179
var groupTargetApi = new RoleBTargetBGroupApi();
176-
await groupTargetApi.AddGroupTargetToGroupRoleAsync(groupId, roleId, targetGroupId);
177-
var targets = await groupTargetApi.ListGroupTargetsForGroupRoleAsync(groupId, roleId).ToListAsync();
180+
await groupTargetApi.AssignGroupTargetToGroupAdminRoleAsync(groupId, roleId, targetGroupId);
181+
var targets = groupTargetApi.ListGroupTargetsForGroupRole(groupId, roleId).ToListAsync();
178182

179-
// Custom roles
183+
// Custom roles (note: methods use generic role naming, not "Custom")
180184
var customRoleApi = new RoleECustomApi();
181-
await customRoleApi.CreateCustomRoleAsync(customRole);
182-
var customRoles = await customRoleApi.ListCustomRoles().ToListAsync();
185+
await customRoleApi.CreateRoleAsync(createIamRoleRequest);
186+
var customRoles = await customRoleApi.ListRolesAsync();
183187
```
184188

185189
### New API Clients
@@ -404,11 +408,11 @@ When you change your project to reference version 9 instead of 8, reference the
404408
- AuthenticatorApi methods that previously returned Authenticator now return AuthenticatorBase.
405409
- GroupApi
406410
- ListGroupUsers
407-
- return type collection of User changed to collectio of GroupMember.
411+
- return type collection of User changed to collection of GroupMember.
408412
- RealmApi
409413
- CreateRealm
410414
- parameter of type Realm changed to CreateRealmRequest.
411-
- UserFacorApi
415+
- UserFactorApi
412416
- ResendEnrollFactor
413417
- parameter of type UserFactor changed to ResendUserFactor.
414418
- return type UserFactor changed to ResendUserFactor.
@@ -429,7 +433,7 @@ See also [added](#added).
429433
### Replaced
430434
The following are methods and classes that have been replaced and the methods or classes that replaced them.
431435

432-
- CustomizationApi is replaced by CustomTemplatesApi, CusomPagesApi and BrandsApi, ThemesApi see [added](#added).
436+
- `OrgSettingCustomizationApi` is replaced by `CustomTemplatesApi`, `CustomPagesApi` and `BrandsApi`, `ThemesApi` see [added](#added).
433437
- RealmApi.UpdateRealm is replaced by RealmApi.ReplaceRealm.
434438
- ProvisioningConnection is replaced by ProvisioningConnectionRequest & ProvisioningConnectionResponse.
435439
- VerifyFactorRequest is replaced by UserFactorVerifyRequest
@@ -450,9 +454,9 @@ The following are methods and APIs that are added in version 9:
450454
- UpsertApiToken
451455
- ApplicationConnectionsApi methods added:
452456
- VerifyProvisioningConnectionForApplication
453-
- AuthorizationAssocApi is a new API to maange authorization server associations.
454-
- AuthorizationServerClaimsApi is a new API to manage authorization server claims.
455-
- AuthroziationServerClientsApi is a new API to manage authorization server clients.
457+
- `AuthorizationServerAssocApi` is a new API to manage authorization server associations.
458+
- `AuthorizationServerClaimsApi` is a new API to manage authorization server claims.
459+
- `AuthorizationServerClientsApi` is a new API to manage authorization server clients.
456460
- AuthorizationServerKeysApi is a new API to manage authorization server keys.
457461
- AuthorizationServerPoliciesApi is a new API to manage authorization server policies.
458462
- AuthorizationServerRulesApi is a new API to manage authorization server rules.
@@ -461,7 +465,7 @@ The following are methods and APIs that are added in version 9:
461465
- UpdateGroupAssignmentToApplication overload accepting a list of JsonPathOperation objects.
462466
- BrandsApi is a new API to manage brands.
463467
- CustomTemplatesApi is new API to manage custom templates.
464-
- CustotmPagesApi is new API to manage custom pages.
468+
- `CustomPagesApi` is a new API to manage custom pages.
465469
- DirectoriesIntegrationApi is a new API to manage AD integrations.
466470
- GroupOwnerApi is a new API to manage group owners.
467471
- InlineHookApi methods added:
@@ -473,7 +477,7 @@ The following are methods and APIs that are added in version 9:
473477
- UpdateThirdPartyAdminSetting
474478
- GetClientPrivilegesSetting
475479
- AssignClientPrivilegesSetting
476-
- RealAssignmentApi is a new API to manage realm assignments.
480+
- `RealmAssignmentApi` is a new API to manage realm assignments.
477481
- SSFReceiverApi is a new API to manage the consumption of security events.
478482
- SSFSecurityEventTokenApi is a new API to manage security event tokens.
479483
- SSFTransmitterApi is a new API to manage security event transmitters.
@@ -1025,7 +1029,7 @@ var groups = await oktaClient.Groups.ListGroupTargetsForGroupRole(createdGroup1.
10251029
_Now:_
10261030

10271031
```csharp
1028-
var _roleAssignmentApi = new RoleAssignmentApi();
1032+
var _roleAssignmentApi = new RoleAssignmentBGroupApi();
10291033

10301034
var role1 = await _roleAssignmentApi.AssignRoleToGroupAsync(createdGroup.Id, new AssignRoleRequest
10311035
{
@@ -1036,9 +1040,9 @@ var roles = await _roleAssignmentApi.ListGroupAssignedRoles(createdGroup.Id).ToL
10361040

10371041
/// ...
10381042
1039-
var _roleTargetApi = new RoleTargetApi();
1043+
var _roleTargetApi = new RoleBTargetBGroupApi();
10401044

1041-
await _roleTargetApi.AddGroupTargetToGroupAdministratorRoleForGroupAsync(group1.Id, role1.Id, group2.Id);
1045+
await _roleTargetApi.AssignGroupTargetToGroupAdminRoleAsync(group1.Id, role1.Id, group2.Id);
10421046

10431047
var groupTargetList = await _roleTargetApi.ListGroupTargetsForGroupRole(createdGroup1.Id, role1.Id).ToListAsync();
10441048
```

0 commit comments

Comments
 (0)