I created a blank abp app as following:
I need to add 2 functions (generate token + generate refresh token) , these will be used by mobile app
Please suggest the best simple way of how to create 2 functions, previously I had a code that creates the token when I was using identity server 4 , now I am using the new framework : openid
(I do not perfer to add account module source code) + ( I perfere to create the function on myApp.Application layer or myApp.HttpApi layer)
I tried this code but did not work, it generated some token but did not work:
string getToken(Volo.Abp.Identity.IdentityUser user, string tokenType)
{
var authServer = configuration["AuthServer:Authority"];
var options = oidcOptions.CurrentValue;
//var roles = user.Roles.Select(r=>r.RoleId)
var descriptor = new SecurityTokenDescriptor
{
Claims = new Dictionary<string, object>
{
{ "sub", user.Id.ToString() },
{ "scope", MainScope.Split(',') },
{ "tenantid", user.TenantId?.ToString() },
//{ "role", user.Roles.Split(',') },
},
EncryptingCredentials = options.DisableAccessTokenEncryption
? null
: options.EncryptionCredentials.First(),
Expires = DateTime.UtcNow.AddMinutes(lifetime),
IssuedAt = DateTime.UtcNow,
Issuer = authServer,
SigningCredentials = options.SigningCredentials.First(),
TokenType = tokenType,
};
var accessToken = options.JsonWebTokenHandler.CreateToken(descriptor);
return accessToken;
}
Thank you
I installed abp version 5.2.0, Cannot use abp suite to create new project on specific version
D:\app>abp suite [10:38:31 INF] ABP CLI (https://abp.io) [10:38:32 INF] Version 5.2.0 (Stable) [10:38:33 WRN] ABP CLI has a newer stable version 8.0.0, please update to get the latest features and fixes. [10:38:33 WRN] [10:38:33 WRN] Update Command: [10:38:33 WRN] dotnet tool update -g Volo.Abp.Cli [10:38:33 WRN] Starting Suite v5.2.0 ... Opening http://localhost:3000 Press Ctrl+C to shut down. [10:40:08 ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null }
[10:40:08 ERR] Object reference not set to an instance of an object. System.NullReferenceException: Object reference not set to an instance of an object. at Volo.Abp.Cli.ProjectBuilding.Templates.RemoveUnnecessaryPortsStep.RemoveUnnecessaryDbMigratorClients(ProjectBuildContext context) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\Templates\RemoveUnnecessaryPortsStep.cs:line 56 at Volo.Abp.Cli.ProjectBuilding.Templates.RemoveUnnecessaryPortsStep.Execute(ProjectBuildContext context) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\Templates\RemoveUnnecessaryPortsStep.cs:line 15 at Volo.Abp.Cli.ProjectBuilding.Building.ProjectBuildPipeline.Execute() in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\Building\ProjectBuildPipeline.cs:line 19 at Volo.Abp.Cli.ProjectBuilding.TemplateProjectBuilder.BuildAsync(ProjectBuildArgs args) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\ProjectBuilding\TemplateProjectBuilder.cs:line 120 at Volo.Abp.Cli.Commands.NewCommand.ExecuteAsync(CommandLineArgs commandLineArgs) in D:\ci\Jenkins\workspace\abp-commercial-release\abp\framework\src\Volo.Abp.Cli.Core\Volo\Abp\Cli\Commands\NewCommand.cs:line 73 at Volo.Abp.Suite.Areas.AbpSuite.CrudPageGenerator.Services.SolutionService.CreateSolutionAsync(CreateSolutionModel input) at lambda_method1665(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.
I have an issue with poor documentation with abp modules which I have without source code; For example the chat module, I read the article (https://docs.abp.io/en/commercial/latest/modules/chat) but I was not able to:
How can I appy such customizations?
I am trying to create a CI/CD pipleline (with azure devops), I have a problem with using the DbMigrator project in that pipeline, I do not want to use abp credentials on the pipeline (to install abp and login with my account, and I have accounts) What are the alternative of creating the database and applying the migrations and seeding the default data.
I read the topic (https://docs.abp.io/en/abp/4.4/Data-Seeding) but I need an alternative way in production environment. (for example is there is a way that I reference the dbMigrator in the host to seed the data on startup)
I have two questions regarding (Commercial & Community) versions: 1- When I use the command line: abp new [Project Name] it always creates the 'commerical' project, Is there a parameter to specify to the abp CLI to create the commercial or community version ? 2- Can I use abp commercial projects in open source project? I mean Is it leagal to create a commercial project and share it as an open source project, or I must use the community version then ?
Thanks
Dears,
Thank you
If you're creating a bug/problem report, please include followings:
Note: The designer needs to he his changes directly upon changes source scss files using gulp watch, so he can customize the theme easily Please note that we do not want to add custom style that Overrides the default theme, we want to customize the theme itself (since we have the source scss of it) which make it easier and faster for us and keep styling code is clean
Can you support us to find a way to see changes of scss files very quicly on the running angular system, (similar to hot reload) ( I remember this feature was up and runing in old versions 4.X.X , cannot tell which one)
Is it possible to load modules dynamicly (instead of referencing modules as attributes and direct assembly reference) I mean something like MEF, And Is it possible to add entities dynamicly in runtime ?
Customizing Angular Templates:
I edited the tempates in abp suite then created Entity using (CRUD Page Generator) in abp suite everything is generated but ignored my custom templates in angular (in backend host, changes are made successfully) All generated code are being done using the default templates! I made sure that there is no (Outdated) templates And there is no error in termninal console
Please support Thank you