RedBear
❔ Question about Azure AD B2C and Front-End Authentication via API
A High level view of how you might do that:
Register the User: Use the "RegisterPortalUser" API to create the user in Azure AD B2C.
Get an Authorization Code: As part of the registration process, you can often redirect the user to a login flow that includes the prompt=login parameter, which will force the user to enter their credentials even if they have a session already. Since the user has just registered, they can input their credentials to get an authorization code without additional interaction.
Exchange the Authorization Code for a Token: Make a POST request to the token endpoint of your Azure AD B2C tenant to exchange the authorization code for an ID token and/or access token.
Set the Token in the User's Session: Use the token to create a session for the user in your application.
6 replies
❔ Question about Azure AD B2C and Front-End Authentication via API
When you're working with Azure AD B2C and you want a user to be automatically signed in after they register, you typically need to follow these steps:
Complete the Sign-Up Process: When a user completes the registration process using the "RegisterPortalUser" API, they should be created as a new user in your Azure AD B2C tenant.
Acquire a Token: After the user is registered, you need to acquire a token on behalf of the user. This usually involves making a request to the Azure AD B2C token endpoint with the proper credentials that the user just registered with.
Use the Token for Authentication: Once you have the token, you can use it to authenticate the user on your website. This typically involves setting the token in the browser as a cookie or in the local/session storage and then configuring your web application to recognize this token and consider the user as logged in.
6 replies
❔ Convert .docx to .pdf without restrictions
LibreOffice/OpenOffice with CLI: LibreOffice and OpenOffice have command-line interfaces that can convert .docx to .pdf without limitations on the number of pages. You can automate the conversion process by using the soffice command.
Apache PDFBox: This is a Java library that can be used to create and manipulate PDF documents. You can use it in combination with Apache POI (which handles .docx files) to convert documents to PDF.
Alternatively, you can use the python-docx library to automate the splitting of the document, if you are at all familiar with that language.
12 replies
❔ How to check Validation Error programically C# in MVVM?
The XAML bindings and ValidationRules define how the errors are displayed, but they do not, by themselves, provide a method to check for errors programmatically. To do that, you would typically have to go through the ViewModel or the code-behind.
11 replies
❔ How to check Validation Error programically C# in MVVM?
To check validation errors programmatically in C# when using the Model-View-ViewModel (MVVM) pattern, you would typically implement the INotifyDataErrorInfo interface for your ViewModel or Model classes. This interface allows you to provide asynchronous validation support and works well with data binding in WPF applications.
Here's a basic outline of the steps you would follow:
Implement INotifyDataErrorInfo: Your ViewModel or Model should implement the INotifyDataErrorInfo interface, which requires you to define an event named ErrorsChanged and methods like GetErrors and HasErrors.
Validate Properties: Within the property setters of your ViewModel or Model, you would perform the validation checks and add any errors to a collection that keeps track of current validation issues.
Notify Validation Errors: When validation errors occur, you should raise the ErrorsChanged event to notify the UI that there are new validation errors to be displayed.
Check Validation Errors Programmatically: You can check for validation errors programmatically by accessing the HasErrors property or by calling the GetErrors method and inspecting the returned values.
11 replies