nn::nex::IndependentServer::RequestAuthenticationToken Member Function

Syntax

qResult RequestAuthenticationToken(
     ProtocolCallContext * pContext,
     qUnsignedInt32 gameServerId,
     const qChar8 * pKeyHash,
     qChar8 * pAuthToken,
     qBool checkParentalControl = true
);

Parameters

Name Description
in pContext The call context.
in gameServerId Game server ID.
in pKeyHash Key hash value.
out pAuthToken Authentication token receive buffer.
The buffer size must be at least AUTH_TOKEN_SIZE.
in checkParentalControl Whether to check Parental Controls.

Return Values

Returns the processing result.

Value Description
QSUCCESS(Core,Success) Successfully started process.
QERROR(Core,InvalidArgument) Invalid argument.
QERROR(Core,CallInitiationFailure) Invalid CallContext state.
QERROR(FPD,NotInitialized) The friend library is not initialized.
QERROR(FPD,NotConnected) Not logged in to NFS. (If using SDK versions prior to SDK 3.2.)

Description

Requests an independent server's authentication token.

Gets an authentication token after authenticating the game to the authentication server. If the system has not obtained a principal ID, this function accesses the friend server and obtains a principal ID during the asynchronous processes in the function.

This function calls nn::friends library asynchronous processes internally by the library. While the asynchronous processing of this function is taking place, do not call the nn::friends::Login function or any other nn::friends library asynchronous processes.

Use the CallContext::GetOutcome function to determine whether the asynchronous processing results indicate success or failure. If a failure, use the GetLastErrorCode function to get the network error code.

When checkParentalControl is set to false, the Online Interaction restriction of the Parental Controls is not checked. For this reason, configure this setting to correctly reflect the nature of the service.

Revision History

2014/09/06
Added that this function accesses the friend server if the system has not obtained a principal ID.
2014/04/16
Changed the notation of the QRESULT_SUCCESS and QRESULT_ERROR return values to QSUCCESS and QERROR.
2012/10/31
Changed gameId to gameServerId.
2011/12/27
Added note that you need to initialize the nn::friends library.
2011/10/24
It is no longer necessary to log in to the friend server to get the authentication token. It is now possible to specify from the application whether to check for the Online Interaction restriction of the Parental Controls.
2011/03/04
Initial version.

CONFIDENTIAL