Skip to content
Open
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog


## 1.0.2
Comment thread
andriizhegurov-okta marked this conversation as resolved.
Outdated

### Features

* Add support for Google Authenticator TOTP.

## 1.0.1

### Updates
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30711.63
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "embedded-auth-with-sdk", "embedded-auth-with-sdk\embedded-auth-with-sdk.csproj", "{88504747-10B6-425F-B27D-66426F7ED199}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "embedded-auth-with-sdk.E2ETests", "Okta.Idx.Sdk.E2ETests\embedded-auth-with-sdk.E2ETests.csproj", "{1E45AB5D-2869-4116-AAD6-6738E61503A8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{88504747-10B6-425F-B27D-66426F7ED199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88504747-10B6-425F-B27D-66426F7ED199}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88504747-10B6-425F-B27D-66426F7ED199}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88504747-10B6-425F-B27D-66426F7ED199}.Release|Any CPU.Build.0 = Release|Any CPU
{1E45AB5D-2869-4116-AAD6-6738E61503A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E45AB5D-2869-4116-AAD6-6738E61503A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E45AB5D-2869-4116-AAD6-6738E61503A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E45AB5D-2869-4116-AAD6-6738E61503A8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ECB24106-EEF7-4E36-9A01-A20216D9B01D}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30711.63
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "embedded-auth-with-sdk", "embedded-auth-with-sdk\embedded-auth-with-sdk.csproj", "{88504747-10B6-425F-B27D-66426F7ED199}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "embedded-auth-with-sdk.E2ETests", "Okta.Idx.Sdk.E2ETests\embedded-auth-with-sdk.E2ETests.csproj", "{1E45AB5D-2869-4116-AAD6-6738E61503A8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{88504747-10B6-425F-B27D-66426F7ED199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88504747-10B6-425F-B27D-66426F7ED199}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88504747-10B6-425F-B27D-66426F7ED199}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88504747-10B6-425F-B27D-66426F7ED199}.Release|Any CPU.Build.0 = Release|Any CPU
{1E45AB5D-2869-4116-AAD6-6738E61503A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1E45AB5D-2869-4116-AAD6-6738E61503A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1E45AB5D-2869-4116-AAD6-6738E61503A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1E45AB5D-2869-4116-AAD6-6738E61503A8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ECB24106-EEF7-4E36-9A01-A20216D9B01D}
EndGlobalSection
EndGlobal
8 changes: 7 additions & 1 deletion src/Okta.Idx.Sdk/Authenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ public class Authenticator : IAuthenticator
public IList<AuthenticatorMethodType> MethodTypes { get; set; }

/// <inheritdoc/>
public string Profile { get; set; }
public string Profile { get; set; }

/// <inheritdoc/>
public IQrCode QrCode { get; set; }

/// <inheritdoc/>
public string SharedSecret { get; set; }
}
}
5 changes: 4 additions & 1 deletion src/Okta.Idx.Sdk/AuthenticatorEnrollment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public class AuthenticatorEnrollment : Resource, IAuthenticatorEnrollment
public IResend Resend => GetResourceProperty<Resend>("resend");

/// <inheritdoc/>
public Resource Profile => GetResourceProperty<Resource>("profile");
public Resource Profile => GetResourceProperty<Resource>("profile");

/// <inheritdoc/>
public IContextualData ContextualData => GetResourceProperty<ContextualData>("contextualData");
}
}
7 changes: 6 additions & 1 deletion src/Okta.Idx.Sdk/AuthenticatorMethodType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ public sealed class AuthenticatorMethodType : StringEnum
/// <summary>
/// Voice
/// </summary>
public static AuthenticatorMethodType Password = new AuthenticatorMethodType("password");
public static AuthenticatorMethodType Password = new AuthenticatorMethodType("password");

/// <summary>
/// Otp
/// </summary>
public static AuthenticatorMethodType Otp = new AuthenticatorMethodType("otp");

/// <summary>
/// Implicit operator declaration to accept and convert a string value as a <see cref="AuthenticatorMethodType"/>
Expand Down
19 changes: 19 additions & 0 deletions src/Okta.Idx.Sdk/ContextualData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// <copyright file="ContextualData.cs" company="Okta, Inc">
// Copyright (c) 2020 - present Okta, Inc. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
// </copyright>

namespace Okta.Idx.Sdk
{
/// <summary>
/// ContextualData type.
/// </summary>
public class ContextualData : Resource, IContextualData
{
/// <inheritdoc/>
public IQrCode QrCode => GetResourceProperty<QrCode>("qrcode");

/// <inheritdoc/>
public string SharedSecret => GetStringProperty("sharedSecret");
}
}
6 changes: 5 additions & 1 deletion src/Okta.Idx.Sdk/Helpers/IdxResponseHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ internal static IList<IAuthenticator> ConvertToAuthenticators(IList<IAuthenticat
Name = authenticator.DisplayName,
MethodTypes = authenticator.Methods?.Select(x => x.Type).ToList(),
EnrollmentId = enrollment?.Id,
Profile = (enrollment != null) ? GetAuthenticatorProfile(enrollment) : string.Empty,
Profile = (enrollment != null) ? GetAuthenticatorProfile(enrollment) : string.Empty,
SharedSecret = enrollment?.ContextualData?.SharedSecret,
QrCode = enrollment?.ContextualData?.QrCode,
});
}

Expand All @@ -38,6 +40,8 @@ internal static IAuthenticator ConvertToAuthenticator(IList<IAuthenticatorValue>
MethodTypes = authenticatorEnrollment.Methods?.Select(x => x.Type).ToList(),
EnrollmentId = authenticatorEnrollment.Id,
Profile = GetAuthenticatorProfile(authenticatorEnrollment),
SharedSecret = authenticatorEnrollment.ContextualData?.SharedSecret,
QrCode = authenticatorEnrollment.ContextualData?.QrCode,
};

internal static string GetAuthenticatorProfile(IAuthenticatorEnrollment authenticatorEnrollment)
Expand Down
12 changes: 11 additions & 1 deletion src/Okta.Idx.Sdk/IAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,15 @@ public interface IAuthenticator
/// Gets or sets the authenticator method types if applicable.
/// </summary>
IList<AuthenticatorMethodType> MethodTypes { get; set; }

/// <summary>
/// Gets or sets the QrCode
/// </summary>
IQrCode QrCode { get; set; }
Comment thread
andriizhegurov-okta marked this conversation as resolved.

/// <summary>
/// Get or Sets the Shared Secret
/// </summary>
string SharedSecret { get; set; }
}
}
}
5 changes: 5 additions & 0 deletions src/Okta.Idx.Sdk/IAuthenticatorEnrollment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,10 @@ public interface IAuthenticatorEnrollment : IResource
/// Gets the resend object.
/// </summary>
IResend Resend { get; }

/// <summary>
/// Gets the ContextualData field
/// </summary>
IContextualData ContextualData { get; }
Comment thread
andriizhegurov-okta marked this conversation as resolved.
}
}
25 changes: 25 additions & 0 deletions src/Okta.Idx.Sdk/IContextualData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// <copyright file="IContextualData.cs" company="Okta, Inc">
// Copyright (c) 2020 - present Okta, Inc. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
// </copyright>

using Okta.Sdk.Abstractions;

namespace Okta.Idx.Sdk
{
/// <summary>
/// An interface to represent ContextualData type.
/// </summary>
public interface IContextualData : IResource
{
/// <summary>
/// Gets the QR Code.
/// </summary>
IQrCode QrCode { get; }

/// <summary>
/// Gets the Shared Secret.
/// </summary>
string SharedSecret { get; }
}
}
30 changes: 30 additions & 0 deletions src/Okta.Idx.Sdk/IQrCode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// <copyright file="IQrCode.cs" company="Okta, Inc">
// Copyright (c) 2020 - present Okta, Inc. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
// </copyright>

using Okta.Sdk.Abstractions;

namespace Okta.Idx.Sdk
{
/// <summary>
/// An Interface to represent QR Code type
/// </summary>
public interface IQrCode : IResource
{
/// <summary>
/// Gets the Method
/// </summary>
string Method { get; }

/// <summary>
/// Gets the Href. The value contains base64-encoded png image with the QR code.
/// </summary>
string Href { get; }
Comment thread
andriizhegurov-okta marked this conversation as resolved.

/// <summary>
/// Gets the Type
/// </summary>
string Type { get; }
}
}
2 changes: 1 addition & 1 deletion src/Okta.Idx.Sdk/Okta.Idx.Sdk.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<LangVersion>7.3</LangVersion>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
22 changes: 22 additions & 0 deletions src/Okta.Idx.Sdk/QrCode.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// <copyright file="QrCode.cs" company="Okta, Inc">
// Copyright (c) 2020 - present Okta, Inc. All rights reserved.
// Licensed under the Apache 2.0 license. See the LICENSE file in the project root for full license information.
// </copyright>

namespace Okta.Idx.Sdk
{
/// <summary>
/// QR Code type
/// </summary>
public class QrCode : Resource, IQrCode
{
/// <inheritdoc/>
public string Method => GetStringProperty("method");

/// <inheritdoc/>
public string Href => GetStringProperty("href");

/// <inheritdoc/>
public string Type => GetStringProperty("type");
}
}