Browse Source

Added Authorization Code Flow and Global Feature System sections

pull/5123/head
Halil İbrahim Kalkan 6 years ago
parent
commit
357167c305
  1. 78
      docs/en/Blog-Posts/2020-08-20 v3_1_Release/Post.md

78
docs/en/Blog-Posts/2020-08-20 v3_1_Release/Post.md

@ -29,6 +29,10 @@ We will continue to publish **nightly builds** for all the [ABP Framework packag
Please try the preview versions and provide feedback to us to release more stable versions. Please open an issue on the [GitHub repository](https://github.com/abpframework/abp/issues/new) if you find a bug.
### Update the ABP CLI to the 3.1.0-rc.1
***TODO***
### New Solutions
The [ABP.IO](https://abp.io/) platform and the [ABP CLI](https://docs.abp.io/en/abp/latest/CLI) are compatible with the RC system. You can select the "preview" option on the [download page](https://abp.io/get-started) or use the "**--preview**" parameter with the ABP CLI [new](https://docs.abp.io/en/abp/latest/CLI?_ga=2.106435654.411298747.1597771169-1910388957.1594128976#new) command:
@ -37,21 +41,85 @@ The [ABP.IO](https://abp.io/) platform and the [ABP CLI](https://docs.abp.io/en/
abp new Acme.BookStore --preview
````
This command will create a new project with the latest RC/Preview version. Whenever the stable version is released, you can switch to the stable version for your solution using the `abp --switch-to-stable` command in the root folder of your solution.
This command will create a new project with the latest RC/Preview version. Whenever the stable version is released, you can switch to the stable version for your solution using the `abp switch-to-stable` command in the root folder of your solution.
### Existing Solutions
If you already have a solution and want to use/test the latest RC/Preview version, use the `abp --switch-to-preview` command in the root folder of your solution. You can return back to the latest stable using the `abp --switch-to-stable ` command later.
If you already have a solution and want to use/test the latest RC/Preview version, use the `abp switch-to-preview` command in the root folder of your solution. You can return back to the latest stable using the `abp switch-to-stable ` command later.
## What's New with the ABP Framework v3.1
> Note that the `abp switch-to-preview` command was being used to switch to nightly builds before the v3.1. Now, you should use the `abp switch-to-nightly` for [nightly builds](https://docs.abp.io/en/abp/latest/Nightly-Builds).
## What's New with the ABP Framework 3.1
### Angular Service Proxies
TODO
ABP provides a system to generate Angular service proxies (with TypeScript) to consume the HTTP APIs of your application. Service proxy generation system **has been completely re-written** with the ABP Framework 3.1. The main goal was to build more stable and feature rich system that is better aligned with other ABP Framework features (like [modularity](https://docs.abp.io/en/abp/latest/Module-Development-Basics)).
[See the documentation](https://docs.abp.io/en/abp/latest/UI/Angular/Service-Proxies) to learn more about the service proxy generation for Angular applications.
### Authorization Code Flow for the Angular UI
We were using the **resource owner password authentication** flow for the Angular UI login page. We've implemented **Authorization Code Flow** for the Angular account module and made it **default for new projects**. With this change, the Angular application now redirects to the login page of the MVC UI which was implemented using the Identity Server 4. We also removed the client secret from the Angular side with this change.
Old behavior remains exist. If you want to switch to the new flow (which is recommended), follow the steps below:
1) Add `authorization_code` to the `IdentityServerClientGrantTypes` table in the database, for the client used by the Angular UI (the `ClientId` is `YourProjectName_App` by default, in the `IdentityServerClients` table).
2) Add `http://localhost:4200` to `IdentityServerClientRedirectUris` and `IdentityServerClientPostLogoutRedirectUris` tables for the same client.
3) Set `RequireClientSecret` to `false` in the `IdentityServerClients` table for the same client.
> [ABP Commercial](https://commercial.abp.io/) users can make these changes on the [Identity Server Management UI](https://commercial.abp.io/modules/Volo.Identityserver.Ui).
4) Change the `oAuthConfig` section in the `src/environments/environment.ts` file of the Angular application.
You can take [this new configuration](https://github.com/abpframework/abp/blob/dev/templates/app/angular/src/environments/environment.ts) as a reference. Main changes are;
* Added `responseType` as `code`.
* Added `redirectUri`
* Added `offline_access` to the `scope`.
* Removed `oidc: false` option.
* Removed the client secret option.
### Global Feature System
TODO
The new "Global Features" system allows to **enable/disable features of an application or a module** in a central point. It is especially useful if you want to use a module but don't want to bring all its features into your application. If the module was so designed, you can enable only the features you need.
When you disable a feature;
* The **database tables** related to that feature should not be included in the database.
* The **HTTP APIs** related to that feature should not be exposed. They returns 404 if they are directly requested.
So, the goal is that; when you disable a feature, it should behave like that feature doesn't exists in your system at all.
There is **no way to enable/disable a global feature on runtime**. You should decide it in the development time (remember, even database tables are not being created for disabled global features, so you can't enable it on runtime).
> "Global Features" system is different than [SaaS/multi-tenancy features](https://docs.abp.io/en/abp/latest/Features), where you can enable/disable features for your tenants on runtime.
Assume that you are using the [CMS Kit module](https://github.com/abpframework/abp/tree/dev/modules/cms-kit) (this module is in a very early stage) where you only want to enable the comment feature:
````csharp
GlobalFeatureManager.Instance.Modules.CmsKit().Comments.Enable();
````
You can check if a feature was enabled:
```csharp
GlobalFeatureManager.Instance.IsEnabled<CommentsFeature>();
```
Or you can add `[RequiresGlobalFeature(...)]` attribute to a controller/page to disable it if the related feature was disabled:
```csharp
//...
[RequiresGlobalFeature(typeof(CommentsFeature))]
public class CommentController : AbpController
{
//...
}
```
See the issue [#5061](https://github.com/abpframework/abp/issues/5061) until this is fully documented.
### New Account Module Features

Loading…
Cancel
Save