Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/470 use new auth properties app and web #477

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

Liteolika
Copy link

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.

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
2 participants