Skip to content

Conversation

@Liteolika
Copy link
Contributor

This PR fixes #470 .

High level overview of this PR:
This pull request introduces a new feature to include detailed information about the end user's device in BankID authentication and signing requests. This complies with the BankID API recommendations.

New Feature: User Device Data

  • Added a new section in the documentation to explain how to resolve the end user's device data and configure the User Device feature (docs/articles/bankid.md). [1] [2]
  • Introduced new interfaces and classes for handling device data in the BankID API, including IBankIdEndUserDeviceData, DeviceData, DeviceDataApp, and DeviceDataWeb (src/ActiveLogin.Authentication.BankId.Api/IBankIdEndUserDeviceData.cs, src/ActiveLogin.Authentication.BankId.Api/Models/DeviceData.cs, src/ActiveLogin.Authentication.BankId.Api/Models/DeviceDataApp.cs, src/ActiveLogin.Authentication.BankId.Api/Models/DeviceDataWeb.cs). [1] [2] [3] [4]
  • Updated AuthRequest and SignRequest models to include deviceParameters for passing device information (src/ActiveLogin.Authentication.BankId.Api/Models/AuthRequest.cs, src/ActiveLogin.Authentication.BankId.Api/Models/SignRequest.cs). [1] [2]

Codebase Enhancements

  • Updated the Program.cs file in the sample project to demonstrate the use of the new User Device feature (samples/Standalone.MvcSample/Program.cs). [1] [2]
  • Added a new data protection class and interface for handling device data state (src/ActiveLogin.Authentication.BankId.AspNetCore/DataProtection/BankIdDeviceDataProtector.cs, src/ActiveLogin.Authentication.BankId.AspNetCore/DataProtection/IBankIdDeviceDataProtector.cs). [1] [2]

Bug Fixes and Miscellaneous

  • Added documentation and fixed a typo in the documentation (docs/articles/bankid.md).
  • Added a new constant for device data refresh interval and a default device data cookie name (src/ActiveLogin.Authentication.BankId.AspNetCore/BankIdConstants.cs).

implementation to support the app/web properties in the request and sign api calls. #370
Updated `BankIdDefaultEndUserAppDeviceDataResolver` to include new properties and improved exception messages. Modified `TryGetAppDeviceParameters` to return a new `DeviceDataApp` object.

Added `BankIdBuilderDeviceDataExtensions` class with `UseDeviceData` method for configuring end user device data.

Refactored `BankIdEndUserDeviceConfigurationBuilder` to remove `IServiceCollection` dependency, using `ServiceDescriptor` for `ResolverFactory` and `Resolvers`. Added methods for adding device resolvers via factory method.

Removed `IBankIdBuilderExtensions` class, moved functionality to `BankIdBuilderDeviceDataExtensions`.

Updated `IBankIdEndUserDeviceConfigurationBuilder` interface to use `ServiceDescriptor` and added method for factory resolvers. Simplified `IBankIdEndUserDeviceDataConfiguration` interface.

Updated tests in `BankIdBuilderExtensions_Tests`, `BankIdEndUserDeviceConfigurationBuilder_Tests`, and `DefaultBankIdEndUserDeviceDataConfiguration_Tests` to reflect changes. Updated `FakeResolver` and `FakeResolverFactory` classes and various `using` directives and namespaces.
Introduced a new feature for resolving end-user device data in BankID authentication and signing requests, enhancing security and user experience. Updated `Program.cs` to include the new `UseDeviceData` configuration for customizable device data resolvers. Refactored various files to improve code maintainability and readability, including `BankIdCommonConfiguration.cs`, `ServiceCollectionBankIdExtensions.cs`, and `BankIdBuilderDeviceDataExtensions.cs`. Added and updated unit tests to ensure correct implementation and functionality of the new feature.
Copy link
Contributor

@elinohlsson elinohlsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Just had some smaller comments and a suggestion for improvement of the documentation.

@elinohlsson elinohlsson added this to the 10.1.0 milestone Jan 16, 2025
Updated AuthRequest, SignRequest, and Request classes to replace deviceParameters with web and app parameters to comply with Bank ID api. Removed SetDeviceParameters method from Request class.

Updated BankIdFlowService to handle new parameters and added GetDeviceData method.

Modified BankIdAppApiClient_Tests to reflect constructor changes.

Removed RequestDeviceParametersTests as it is no longer relevant.

#470
@Liteolika Liteolika requested a review from elinohlsson January 17, 2025 09:55
@elinohlsson elinohlsson merged commit db2d0d7 into main Jan 17, 2025
19 checks passed
@elinohlsson elinohlsson deleted the feature/470-use-new-auth-properties-app-and-web branch January 17, 2025 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use new auth properties app and web

3 participants