-
Notifications
You must be signed in to change notification settings - Fork 12
Getting Started
BhakareAbhishek edited this page May 2, 2024
·
15 revisions
Check the connection string in the appsettings.json file under the .Web project.
"ConnectionStrings": {"Default": "Server=localhost;Database=BookStore;Trusted_Connection=True"}
Change the CorsOrigins, RedirectAllowedUrls in the appsettings.json file under the **.HttpApi.Host project.
"CorsOrigins": "http://localhost:8080",
"RedirectAllowedUrls": "http://localhost:8080"
The CorsOrigins setting defines the allowed origins for Cross-Origin Resource Sharing (CORS). This setting allows requests from the specified origins. In this configuration, 'http://localhost:8080/' is included to allow requests from a local development server, typically used for development and testing purposes. RedirectAllowedUrls setting is used to define a whitelist of safe domains to which redirection is permitted
Please follow these steps to add an OpenID application through the POST API using Swagger:
- Open your API's Swagger interface.
- Find the POST endpoint (/api/openiddict/applications) for adding data.
- Click "Try it out" to submit the request.
- Enter your JSON data in the request body.
{
"applicationType": "web", // Type of application (e.g., web, mobile)
"clientId": "<Your_Client_ID>", // Client ID for the application
"displayName": "<Your_Display_Name>" // Display name for the application
"clientType": "public", // Type of client (e.g., public, confidential)
"clientSecret": null, // Client secret for the application
"consentType": "implicit", // Type of consent (e.g., implicit, explicit,external, systematic)
"extensionGrantTypes": [ // Extension grant types allowed
"LinkLogin",
"Impersonation"
],
"postLogoutRedirectUris": [ // URIs to redirect to after logout
"http://localhost:8080"
],
"redirectUris": [ // URIs to redirect to after authorization
"http://localhost:8080"
],
"allowPasswordFlow": true,
"allowClientCredentialsFlow": true,
"allowAuthorizationCodeFlow": true,
"allowRefreshTokenFlow": true,
"allowHybridFlow": false,
"allowImplicitFlow": false,
"allowLogoutEndpoint": true,
"allowDeviceEndpoint": false,
"scopes": [ // Scopes available for the application
"address",
"email",
"phone",
"profile",
"roles",
"Test" // Backend application name
],
"clientUri": "http://localhost:8080", // URI for the client application
"logoUri": "<Logo_URI>" // URI for the application's logo
}
- Check the response for confirmation.
- Run the command on the root directory of your solution to install the dependencies
npm run install-all
- Modifications in .env file
NODE_ENV=production
REACT_APP_URL=http://localhost:8080
REACT_APP_API_URL=<Swagger_URL>
REACT_APP_GRANT_TYPE=authorization_code
REACT_APP_CLIENT_ID=<Your_Client_ID>
REACT_APP_SCOPE=address openid email phone profile roles offline_access <Backend_Application_Name>
REACT_APP_REPLACE_URL=true
REACT_APP_VERSION=8.0
- Run the command on the root directory to run the solution
npm run start --projects=host,rds-page-home,rds-page-login,rds-page-dashboard,rds-page-tenant
Above command will run the following pages
- rds-page-home
- rds-page-login
- rds-page-dashboard
- rds-page-tenant
- Install Node Module: Use npm run install-all to install the required Node.js modules for your project.
npm run install-all
- Run the Storybook: Execute npm run storybook to start the Storybook development server.
npm run storybook
- Build Storybook: Generate a production build of Storybook using npm run build-storybook.
npm run build-storybook
- Check the npm package: Build your project using npm run build, which typically compiles your code and assets for deployment.
npm run build-storybook