// Copyright Epic Games, Inc. All Rights Reserved. // This file is automatically generated. Changes to this file may be overwritten. namespace Epic.OnlineServices.Auth { /// /// A structure that contains login credentials. What is required is dependent on the type of login being initiated. /// /// This is part of the input structure and related to device auth. /// /// Use of the ID and Token fields differs based on the Type. They should be null, unless specified: /// - ID is the email address, and Token is the password. /// - Token is the exchange code. /// - If targeting console platforms, Token is the long lived refresh token. Otherwise N/A. /// - N/A. /// - ID is the host (e.g. localhost:6547), and Token is the credential name registered in the EOS Developer Authentication Tool. /// - Token is the refresh token. /// - SystemAuthCredentialsOptions may be required if targeting mobile platforms. Otherwise N/A. /// - Token is the external auth token specified by ExternalType. /// /// /// /// public class Credentials : ISettable { /// /// ID of the user logging in, based on /// public string Id { get; set; } /// /// Credentials or token related to the user logging in /// public string Token { get; set; } /// /// Type of login. Needed to identify the auth method to use /// public LoginCredentialType Type { get; set; } /// /// This field is for system specific options, if any. /// /// If provided, the structure will be located in (System)/eos_(system).h. /// The structure will be named EOS_(System)_Auth_CredentialsOptions. /// public System.IntPtr SystemAuthCredentialsOptions { get; set; } /// /// Type of external login. Needed to identify the external auth method to use. /// Used when login type is set to , ignored for other methods. /// public ExternalCredentialType ExternalType { get; set; } internal void Set(CredentialsInternal? other) { if (other != null) { Id = other.Value.Id; Token = other.Value.Token; Type = other.Value.Type; SystemAuthCredentialsOptions = other.Value.SystemAuthCredentialsOptions; ExternalType = other.Value.ExternalType; } } public void Set(object other) { Set(other as CredentialsInternal?); } } [System.Runtime.InteropServices.StructLayout(System.Runtime.InteropServices.LayoutKind.Sequential, Pack = 8)] internal struct CredentialsInternal : ISettable, System.IDisposable { private int m_ApiVersion; private System.IntPtr m_Id; private System.IntPtr m_Token; private LoginCredentialType m_Type; private System.IntPtr m_SystemAuthCredentialsOptions; private ExternalCredentialType m_ExternalType; public string Id { get { string value; Helper.TryMarshalGet(m_Id, out value); return value; } set { Helper.TryMarshalSet(ref m_Id, value); } } public string Token { get { string value; Helper.TryMarshalGet(m_Token, out value); return value; } set { Helper.TryMarshalSet(ref m_Token, value); } } public LoginCredentialType Type { get { return m_Type; } set { m_Type = value; } } public System.IntPtr SystemAuthCredentialsOptions { get { return m_SystemAuthCredentialsOptions; } set { m_SystemAuthCredentialsOptions = value; } } public ExternalCredentialType ExternalType { get { return m_ExternalType; } set { m_ExternalType = value; } } public void Set(Credentials other) { if (other != null) { m_ApiVersion = AuthInterface.CredentialsApiLatest; Id = other.Id; Token = other.Token; Type = other.Type; SystemAuthCredentialsOptions = other.SystemAuthCredentialsOptions; ExternalType = other.ExternalType; } } public void Set(object other) { Set(other as Credentials); } public void Dispose() { Helper.TryMarshalDispose(ref m_Id); Helper.TryMarshalDispose(ref m_Token); Helper.TryMarshalDispose(ref m_SystemAuthCredentialsOptions); } } }