AuthInfo.h 3.04 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/*
AuthInfo.h
Copyright (C) 2015  Belledonne Communications, Grenoble, France
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
15 16 17 18 19 20 21
*/

#pragma once

#include "ApiLock.h"
#include "Core.h"

22
namespace BelledonneCommunications
23
{
24
	namespace Linphone
25
	{
26
		namespace Native
27 28
		{
			/// <summary>
29 30 31 32 33 34 35 36
			/// Object holding authentication information.
			/// In most cases, authentication information consists in an username and a password.
			/// Sometimes, a userid is required by the proxy, and realm can be useful to discriminate different SIP domains.
			/// This object is instanciated using Core::CreateAuthInfo.
			/// Once created and filled, a AuthInfo must be added to the Core in order to become known and used automatically when needed.
			/// The Core object can take the initiative to request authentication information when needed in the application through the CoreListener::AuthInfoRequested listener.
			/// The application can respond to this information request later using Core::AddAuthInfo.
			/// This will unblock all pending authentication transactions and retry them with authentication headers.
37
			/// </summary>
38
			public ref class AuthInfo sealed
39
			{
40 41 42 43 44 45 46 47 48
			public:
				/// <summary>
				/// The authentication ha1.
				/// </summary>
				property Platform::String^ Ha1
				{
					Platform::String^ get();
					void set(Platform::String^ value);
				}
49

50 51 52 53 54 55 56 57
				/// <summary>
				/// The authentication password.
				/// </summary>
				property Platform::String^ Passwd
				{
					Platform::String^ get();
					void set(Platform::String^ value);
				}
58

59 60 61 62 63 64 65 66
				/// <summary>
				/// The authentication realm.
				/// </summary>
				property Platform::String^ Realm
				{
					Platform::String^ get();
					void set(Platform::String^ value);
				}
67

68 69 70 71 72 73 74 75
				/// <summary>
				/// The authentication userid.
				/// </summary>
				property Platform::String^ Userid
				{
					Platform::String^ get();
					void set(Platform::String^ value);
				}
76

77 78 79 80 81 82 83 84
				/// <summary>
				/// The authentication username.
				/// </summary>
				property Platform::String^ Username
				{
					Platform::String^ get();
					void set(Platform::String^ value);
				}
85

86 87 88
			private:
				friend class Utils;
				friend ref class Core;
89

90 91 92
				AuthInfo(Platform::String^ username, Platform::String^ userid, Platform::String^ password, Platform::String^ ha1, Platform::String^ realm, Platform::String^ domain);
				AuthInfo(::LinphoneAuthInfo *auth_info);
				~AuthInfo();
93

94 95 96
				::LinphoneAuthInfo *auth_info;
			};
		}
97
	}
98
}