Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
If you're creating a bug/problem report, please include followings:
1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action1 optionsAction)
at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action`1 optionsAction)
at AuthServer.Program.Main(String[] args) in /src/Program.cs:line 27This is line 141 from AuthserverModule.cs
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
This is my auth server deployment.yaml
# Source: authserver/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: authserver
namespace: abp-app
spec:
selector:
matchLabels:
app: authserver
replicas: 1
template:
metadata:
labels:
app: authserver
spec:
containers:
- name: authserver
image: cprtestregistry.azurecr.io/authserver:v1.1
imagePullPolicy: Always
ports:
- name: http
containerPort: 80
- name: https
containerPort: 443
env:
- name: StringEncryption__DefaultPassPhrase
value: ert134134t1qqerg
- name: App__CorsOrigins
value: https://public-gateway.cloverleafcms.dev,https://web-gateway.cloverleafcms.dev
- name: App__DisablePII
value: "true"
- name: App__RedirectAllowedUrls
value: https://admin.cloverleafcms.dev,https://admin.cloverleafcms.dev,
- name: App__SelfUrl
value: https://auth.cloverleafcms.dev
- name: AuthServer__Authority
value: https://auth.cloverleafcms.dev
- name: AuthServer__RequireHttpsMetadata
value: "false"
- name: AuthServer__SwaggerClientId
value: WebGateway_Swagger
- name: ConnectionStrings__AdministrationService
value: Server=***
- name: ConnectionStrings__IdentityService
value: Server=***
- name: ConnectionStrings__SaasService
value: Server=***
- name: DOTNET_ENVIRONMENT
value: Staging
- name: ElasticSearch__Url
value: http://elasticsearch
- name: Redis__Configuration
value: http://redis
This is my redis service.yaml file:
apiVersion: v1
kind: Service
metadata:
labels:
name: redis
name: redis
spec:
type: ClusterIP
ports:
- name: redis
port: 6379
selector:
app: redis
I've verified that the redis service is running via kubectl get services redis ClusterIP 10.2.92.53
I've also tried using value: redis for the Redis__Configuration env and get this in the pod log: It was not possible to connect to the redis server(s). UnableToConnect on redis:6379/Interactive, Initializing/NotStarted, last: NONE, origin: BeginConnectAsync, outstanding: 0, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: Connecting, mgr: 10 of 10 available, last-heartbeat: never, global: 0s ago, v: 2.2.4.27433 at StackExchange.Redis.ConnectionMultiplexer.ConnectImpl(ConfigurationOptions configuration, TextWriter log) in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 1163
We'd like to use the abp modules/libraries rather than write our own OAUTH flow.
The template project is already integrated with Identity Server or OpenIddict. You don't need to write any code.
What I'd like to know is if those routes can be exposed as external REST API's that can be called using Axios or Ajax from the Vuejs app. yo
On the contrary if AJAX returns token this may require more code.
Hi and thanks again for your quick response. I may not be asking the question correctly so I'll try to be more specific.
We need to be able to get the authentication / authorization credentials that are used in the [Authorize] interface of the microservices.
We will have a custom web application built with Vuejs and we will also need to expose REST API's to some of our clients who are using other applications.
So, the work flow would look something like this:
We do not want a redirect to another application UI for authentication given that we'll also have external applications accessing the API's directly.
I realize we'll have additional code to write, but can we use the Abp modules (specifically Account, Identity and OpendIDDict) for the above using only REST API's? If so, how would we go about doing that?
Thanks
It seems the login from a web app is only through a redirect to the MVC Authentication app. Is that accurate?
hi
You can use
oauth2-oidclibrary in vue like angular-oauth2-oidcabp supports authorization code and password grant types to get access token and id token.
https://developer.okta.com/blog/2018/04/10/oauth-authorization-code-grant-type https://developer.okta.com/blog/2018/06/29/what-is-the-oauth2-password-grant#the-oauth-20-password-grant
Thank you but that doesn't really answer my question.
We'd like to use the abp modules/libraries rather than write our own OAUTH flow.
Going through the code on GitHub it looks like the login route (for example) is used in the Nuget package that contains the MVC app. abp/modules/account/src/Volo.Abp.Account.HttpApi/Volo/Abp/Account/AccountController.cs
What I'd like to know is if those routes can be exposed as external REST API's that can be called using Axios or Ajax from the Vuejs app.
Thanks
We're using App Commercial and the Microservices template.
We want to build a custom UI with Vue JS as the front end and using the API's in the micro-services on the back end. I'm having a hard time figuring out which services and API(s) to use to login a user to get an access token and the permissions for their roles.
It seems the login from a web app is only through a redirect to the MVC Authentication app. Is that accurate?
If not, can someone guide me?
Thank you.