Skip to content

Verification Code

Antoine CLOP edited this page Aug 1, 2020 · 3 revisions

Verification Code

Riot introduced Verification Code (also know as Third Party Code). It is a authentication system that confirms the identity of a summoner. Players have the possibility to enter a code in the client settings. Then using Riot API an application can receive this code and validate that the player owns the account.

Methods

ThirdPartyVerificationCode

Parameters

  • SummonerId: Represents the unique identifier of a summoner. See Summoners to get this identifier.
  • Region: The region where the summoner plays.

Since this method is asynchrone, there is not return value. Response will be provided with a handler closure with parameters: (String?, String?). String contains the verification code if it exists and will be nil only if summoner was not found on this Region or he did not enter a valid verification code. Valid verification code can only contain letters (lower and upper case), numbers and '-', with 256 characters maximum. The String parameter contains the first error description encountered if existing.

Usage example

league.lolAPI.getThirdPartyVerificationCode(by: SummonerId("xc8IRVLGV1Gb75sbz8JoLdRvIJ_yAKNsSG1RBQVtnGZqZV8"), on: .EUW) { (verificationCode, errorMsg) in
    if let verificationCode = verificationCode {
        print("Success!")
    }
    else {
        print("Request failed cause: \(errorMsg ?? "No error description")")
    }
}
Clone this wiki locally