I was able to integrate using the below information : https://{myoktadomain}/.well-known/openid-configuration and use authorization_endpoint as LoginUrl and issuer as Authority.
Now I am having below issue :
{ "model": { "authProvider": "OpenIdConnect", "providerKey": "xxxxxxxxxxxxxxxxxxxxxxxx", "providerAccessCode": "ceyJraWQiOiJBQjQ3eE1VZVp5N2FLTEpnalhfc0pxeXdZNHBXVDF2NFZDbWNfOG1mMU13IiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiIwMHUxcTdybDBPTzF3bUY4WjM1NiIsInZlciI6MSwiaXNzIjoiaHR0cHM6Ly9jYXN0YW5kY3Jldy1kZXYub2t0YS5jb20iLCJhdWQiOiIwb2EyaXI4b2xPakQ1YlgzQTM1NiIsImlhdCI6MTUzOTuY0NDMzOSwiZXhwIjoxNTM5NjQ3OTM5LCJqdGkiOiJJRC4wNXBxbTNUbW5nMS1YQVo2alVIOEhuQ3VPbE9ucFRFbVc1TGdBVGZweEVJIiwiYW1yIjpbInB3ZCJdLCJpZHAiOiIwMG9panRnMDFtOEVXY1FTRTM1NSIsIm5vbmNlIjoieUJ3cGdocEFDekZHMllvbDA3cUNYMXVPYWNzUUx5UjhweURXdk5zdSIsImF1dGhfdGltZSI6MTUzOTY0NDIyMn0.HMEe32StW5IAfiWZU0s0VNlkJoxiuG1C87knX9LLZmesg5ykhdDG7232NuolsdSHRNqzar9HH4u-phB_BiKMo04cFcVDNnflZuruf4YTR77C_UN3j5xjSGJQU9xZifyFlfJHGUUClUBcPjyJSk3246hRxgSOk5qR10Yb0kG0QtkWkaUJd39A-7wsDZ4zoCkRTtJaDvmAZyY5VTmuPijryLVSiEcX6cAoevHJZe3bolfUtlwu596amS2pWHUBbWIgKz2IydEveAiHhhL9LRoBt9A6akJ_Pu_QP04XfV7xZZwzVr39izPKkealdMtzFNCsGgWzDd1wTaXTtw6jDfs1zSg", "returnUrl": null, "singleSignIn": false } }
Error State :
System.InvalidOperationException: Sequence contains no matching element
at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func
2 predicate)
at Abp.AspNetZeroCore.Web.Authentication.External.OpenIdConnect.OpenIdConnectAuthProviderApi.GetUserInfo(String token)
at CASTANDCREW.ETC.Web.Controllers.TokenAuthController.GetExternalUserInfo(ExternalAuthenticateModel model) in C:\CASTANDCREW\NewETC\aspnet-core\src\CASTANDCREW.ETC.Web.Core\Controllers\TokenAuthController.cs:line 384
at CASTANDCREW.ETC.Web.Controllers.TokenAuthController.ExternalAuthenticate(ExternalAuthenticateModel model) in C:\CASTANDCREW\NewETC\aspnet-core\src\CASTANDCREW.ETC.Web.Core\Controllers\TokenAuthController.cs:line 266
at lambda_method(Closure , Object )
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync()
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
What am i missing?
Hi -
I am trying to integrate Okta in Abp using OpenId and below is the documentation :
https://developer.okta.com/docs/api/resources/oidc
After going through the documentation for OpenID for Abp here are my questions :
"OpenId": { "IsEnabled": "true", "ClientId": "", "Authority": "", "LoginUrl": "" }
I am kind of stuck and need your help ASAP. Thanks in Advance.
+1
I have a madate to use Okta for authentication. @cmthomps can you share your code and also can you let me know how are you managing users and assigning them Tenants using Okta
Severity Code Description Project File Line Suppression State Error CS0234 The type or namespace name 'Services' does not exist in the namespace 'CASTANDCREW.ETC.Web' (are you missing an assembly reference?) CASTANDCREW.ETC.Application C:\CASTANDCREW\ETC\aspnet-core\src\CASTANDCREW.ETC.Application\DemoUiComponents\DemoUiComponentsAppService.cs 9 Active
using CASTANDCREW.ETC.Web.Services; this doesn't show up in intellisense as well
It's a namespace issue I am encounterin. So can't even compile:
using System; using System.Collections.Generic; using System.Linq; using Abp; using Abp.Authorization; using CASTANDCREW.ETC.Authorization; using CASTANDCREW.ETC.DemoUiComponents.Dto; using CASTANDCREW.ETC.Web;
namespace CASTANDCREW.ETC.DemoUiComponents { [AbpAuthorize(AppPermissions.Pages_DemoUiComponents)] public class DemoUiComponentsAppService : ETCAppServiceBase, IDemoUiComponentsAppService { private readonly IS3Services _iS3Services;
Below is my code for SService and IS3ervice :
using Amazon.KeyManagementService; using Amazon.KeyManagementService.Model; using Amazon.S3; using Amazon.S3.Model; using Amazon.S3.Util; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks;
namespace CASTANDCREW.ETC.Web.Services { public class S3Services : IS3Services { private readonly IAmazonS3 _S3client; private readonly IAmazonKeyManagementService _KMSclient;
public S3Services(IAmazonS3 S3client, IAmazonKeyManagementService KMSclient)
{
_S3client = S3client;
_KMSclient = KMSclient;
}
public async Task CreateBucketAsync(string bucketname)
{
try
{
if (await AmazonS3Util.DoesS3BucketExistAsync(_S3client, bucketname) == false)
{
var response = _KMSclient.CreateKeyAsync(new CreateKeyRequest());
string keyId = response.Result.KeyMetadata.KeyId;
var createAliasRequest = new CreateAliasRequest
{
AliasName = "etcplus-TenancyName-Env",
TargetKeyId = keyId
};
CreateAliasResponse x = await _KMSclient.CreateAliasAsync(createAliasRequest);
var putBucketRequest = new PutBucketRequest
{
BucketName = bucketname,
UseClientRegion = true
};
PutBucketResponse putBucketResponse = await _S3client.PutBucketAsync(putBucketRequest);
var getBucketPolicyRequest = new GetBucketPolicyRequest
{
BucketName = bucketname
};
// Get the existing policy from the Bucket
GetBucketPolicyResponse getBucketPolicyResponse = await _S3client.GetBucketPolicyAsync(getBucketPolicyRequest);
//Modify the policy and then put the new policy
string existingPolicy = getBucketPolicyResponse.Policy;
var putBucketPolicyRequest = new PutBucketPolicyRequest
{
BucketName = bucketname,
Policy = existingPolicy
};
PutBucketPolicyResponse putBucketPolicyResponse = await _S3client.PutBucketPolicyAsync(putBucketPolicyRequest);
}
}
catch (AmazonS3Exception ex)
{
throw ex;
}
catch (Exception ex)
{
throw ex;
}
}
}
}
namespace CASTANDCREW.ETC.Web.Services { public interface IS3Services { } }
My bad. Poor choice of words.
I am trying to inject in the DemoComponentUiServices :
[AbpAuthorize(AppPermissions.Pages_DemoUiComponents)]
public class DemoUiComponentsAppService : ETCAppServiceBase, IDemoUiComponentsAppService
{
private readonly IS3Services _iS3Services;
I am unable to do so.
I plan to use S3 bucket for file storage. And plan to use it for Upload, Delete, versioning etc. In order to achieve that this is what I did :
services.AddDefaultAWSOptions(_appConfiguration.GetAWSOptions()); services.AddAWSService<IAmazonS3>(); services.AddSingleton<IS3Services, S3Services>(); services.AddAWSService<IAmazonKeyManagementService>();
I created a folder in XXX.XXXX.Web.Host called Services and created a class called S3Services :
public class S3Services : IS3Services { private readonly IAmazonS3 _S3client; private readonly IAmazonKeyManagementService _KMSclient;
` public S3Services(IAmazonS3 S3client, IAmazonKeyManagementService KMSclient)
{
_S3client = S3client;
_KMSclient = KMSclient;
}
public async Task CreateBucketAsync(string bucketname)
{
try
{
if (await AmazonS3Util.DoesS3BucketExistAsync(_S3client, bucketname) == false)
{
var response = _KMSclient.CreateKeyAsync(new CreateKeyRequest());
string keyId = response.Result.KeyMetadata.KeyId;
var createAliasRequest = new CreateAliasRequest
{
AliasName = "etcplus-TenancyName-Env",
TargetKeyId = keyId
};
CreateAliasResponse x = await _KMSclient.CreateAliasAsync(createAliasRequest);
var putBucketRequest = new PutBucketRequest
{
BucketName = bucketname,
UseClientRegion = true
};
PutBucketResponse putBucketResponse = await _S3client.PutBucketAsync(putBucketRequest);
var getBucketPolicyRequest = new GetBucketPolicyRequest
{
BucketName = bucketname
};
// Get the existing policy from the Bucket
GetBucketPolicyResponse getBucketPolicyResponse = await _S3client.GetBucketPolicyAsync(getBucketPolicyRequest);
//Modify the policy and then put the new policy
string existingPolicy = getBucketPolicyResponse.Policy;
var putBucketPolicyRequest = new PutBucketPolicyRequest
{
BucketName = bucketname,
Policy = existingPolicy
};
PutBucketPolicyResponse putBucketPolicyResponse = await _S3client.PutBucketPolicyAsync(putBucketPolicyRequest);
}
}
catch (AmazonS3Exception ex)
{
throw ex;
}
catch (Exception ex)
{
throw ex;
}
}
}`
Now I want to inject this into the controller class in Web.Core and .Application classes. When I attempt that it's not showing up.
Am I missing any refrence or am I doing the worng way.
The whole purpose is to Inject the AmazonS3 client and handle file operations in the application.
If you can guide me in teh right direction that would be very helpful
I have been using AspnetZero i guess from the beginning and it's good to see how it has evolved. This question is still open for me after two years. I am developing a new product and using ASPNET ZERO Angular + Core.
I think I completely understand how ASPNETZERO works, so here is my question. When I add an user I can specify the permissions using Roles, and then I can make changes to a specific user permission by going to user screen.
My Requirement :
When I add an user I get to choose the Organization to which I want to add. Is there a way I can also select set of permissions that's applicable for an user specific to that Organization. In a way I want to extend the Permission to Organization as well.
I was thinking of extending the AbpPermissions entity and add IMayhaveOrganization. But not sure what all places I have to make the changes to make sure the data annotations also work.
Let me know my ask is clear
I tried resolving : <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate-templates/issues/43#issuecomment-401640552">https://github.com/aspnetboilerplate/as ... -401640552</a>
But now after deployment the connection string for the secondary database is being picked up from appsettings.json instead of appsettings.production.json
Do we have a solution to this problem ?
use it like the below :
Server=S15PC-04\SQLEXPRESS; Database=DemoNg5Db; Trusted_Connection=True;
Remove the extra ""