/
Activate()

Activate()

Activate a user account

Description

The Activate() method is used to assign a GCKey MBUN to a user via an activation (enrollment) key.

Package Details

Interface

IAccountManager

Syntax

AccountManager.Activate( UserActivationContext userActivationContext )

Returns

Task<User>

API

[POST] /api/v1/account/activate

Sample request body

{ "EnrollmentKey": "string", "ServiceId": "int", "AuthenticationContext": { "Type": "GCKey", "GCKey": { "MBUN": "string", "Issuer": "string" }, "WindowsUserName": "string" } }

Returns

UserDTO

Example

using MTOA.BLL.Interfaces; int myServiceId = 123; string enrollmentKey = "xyz"; // Retrieve from URI User user = await _accountManager.Activate(enrollmentKey, BaseController.AuthenticationContext, myServiceId ); if (user != null) { _logger.Info( $"User {user.FirstName} {user.LastName} is now bound to their account using {enrollmentKey}"); } else { _logger.Error($"Failed to bind user to key {enrollmentKey}"); }

Related references

 

Related content

MTOA Web Service Framework
MTOA Web Service Framework
Read with this
Register()
Register()
More like this
Integration of .NET 4.X solution with the myTC Account Platform
Integration of .NET 4.X solution with the myTC Account Platform
Read with this
EnrollUser()
EnrollUser()
More like this
MTAPI Response Codes
MTAPI Response Codes
Read with this
Enrollment
Enrollment
More like this