I am new to programming and I am building a web api project using dotnet core 5. I have installed MailKit in order to send emails, but it not works. Here are my configurations:
services.AddMailKit(config =>
{
config.UseMailKit(configuration.GetSection("Email").Get<MailKitOptions>());
});
Also my appsettings:
{
"ConnectionStrings": {
"xxxxxxx"
},
"Email": {
"Server": "smtp.gmail.com",
"Port": 465,
"SenderName": "xxxx",
"SenderEmail": "xxxx#gmail.com",
"Account": "xxxx",
"Password": "xxxx",
"Security": true
},
"JWT": {
"ValidAudience": "User",
"ValidIssuer": "https://localhost:5001",
"Secret": "aslkjsdfl;afa;falkajs"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
My gmail password and address is correct. Also I have enabled less secure apps in google account. Here is how I send emails:
await _emailService.SendAsync(user.Email, "Email Verification", emailVereificationLink);
Related
I need to use two reporters with my Cypress tests: mochawesome to generate html reports, and autoset-status-cypress-testrail-reporter to publish test results to Testrail.
The main tool I could find that would enable me to use multiple reporters is cypress-multi-reporters.
However, If I try to use cypress-multi-reporters with autoset-status-cypress-testrail-reporter, alone or in conjunction with mochawesome as below (in cypress.json), it does not work. It will not print out any errors, but it just will not publish the results to Testrail, and it will not generate the mochawesome reports.
{
"reporterEnabled": "mochawesome, autoset-status-cypress-testrail-reporter",
"mochawesomeReporterOptions": {
"reportDir": "cypress/reports",
"overwrite": false,
"html": true,
"json": false
},
"autosetStatusCypressTestrailReporterReporterOptions": {
"host": "https://xxxxxx/",
"username": "xxxxx",
"password": "xxxx",
"projectId": 1,
"runId": 1234
}
}
Can anyone tell me why the above is not working, or suggest a similar tool that would work with both mochawesome and autoset-status-cypress-testrail-reporter?
Got this to work in the end. The solution was
OPTION 1 - to include only the below in cypress.json:
"reporter": "cypress-multi-reporters",
"reporterOptions": {
"configFile": "reporter-config.json"
}
Then to create a new file called reporter-config.json, and add the config for each reporter in there:
{
"reporterEnabled": "mochawesome, autoset-status-cypress-testrail-reporter",
"mochawesomeReporterOptions": {
"reportDir": "cypress/reports",
"overwrite": false,
"html": true,
"json": false
},
"autosetStatusCypressTestrailReporterReporterOptions": {
"host": "https://xxxxxx/",
"username": "xxxxx",
"password": "xxxx",
"projectId": 1,
"runId": 1234
}
}
OPTION 2 - to have everything inside cypress.json, like so:
"reporter": "cypress-multi-reporters",
"reporterOptions": {
"reporterEnabled": "mochawesome, autoset-status-cypress-testrail-reporter",
"mochawesomeReporterOptions": {
"reportDir": "cypress/reports",
"overwrite": false,
"html": true,
"json": false
},
"autosetStatusCypressTestrailReporterReporterOptions": {
"host": "https://xxxxxx/",
"username": "xxxxx",
"password": "xxxx",
"projectId": 1,
"runId": 1234
}
}
I'm currently seeing this error when I try and save my connector configuration:
21T21:05:12.087Z ngClickDecorator: value not found in enum type. value:
and
21T21:05:12.155Z Received error from connectors {"seq":1611247472155,"timestamp":1611263112143,"flightSettings": {"Name":"ConnectorFrontEndSettings","AriaSDKToken":"d127f72a3abd41c9b9dd94faca947689-d58285e6-3a68-4cab-a458-37b9d9761d35-7033","SPAEnabled":true,"ClassificationFilterEnabled":true,
"ClientRoutingEnabled":true,"EnableYammerGroupOption":true,
"EnableFadeMessage":false,"EnableDomainBasedOwaConnectorList":false,
"EnableDomainBasedTeamsConnectorList":false,"DevPortalSPAEnabled":true,
"ShowHomeNavigationButtonOnConfigurationPage":false,"DisableConnectToO365InlineDeleteFeedbackPage":true},"status":500,"clientType":"SkypeSpaces",
"connectorType":"c6adb316-46b2-4e46-a511-8b4947b3d554","name":"handleMessageError"}
And the SO post: Can't save custom connector configuration is very close to my problem however I have added my configurationURL to my valid domains, and removed mine from the manifest but with still no luck. I'm all set up on my permissions as well unless there is something specific I am missing to configure?
Any suggestions, below is my manifest and code:
Manifest:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.8/MicrosoftTeams.schema.json",
"manifestVersion": "1.8",
"version": "1.0.3",
"showLoadingIndicator": true,
"isFullScreen": true,
"id": "c6adb316-46b2-4e46-a511-8b4947b3d554",
"packageName": "com.test",
"developer": {
"name": "Test, Inc",
"websiteUrl": "https://test.com",
"privacyUrl": "https://test.com/privacy",
"termsOfUseUrl": "https://test.com/toc"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"connectors": [
{
"connectorId": "c6adb316-46b2-4e46-a511-8b4947b3d554",
"scopes": [
"team"
],
"configurationUrl": "https://localdev-test.test.com/connector"
}
],
"name": {
"short": "Test Development",
"full": "Test for Microsoft Teams"
},
"description": {
"short": "Test Development",
"full": "Test for Microsoft Teams"
},
"accentColor": "#FFFFFF",
"staticTabs": [
{
"entityId": "22f101b6-f9a2-44d3-8eba-74309295f398",
"scopes": [
"personal"
],
"context":[
"personalTab",
"channelTab"
],
"name": "TestSite",
"contentUrl": "https://localdev-test.test.com",
"websiteUrl": "https://localdev-test.test.com",
"searchUrl": "https://localdev-test.test.com"
}
],
"devicePermissions": [
"notifications",
"openExternal"
],
"permissions": [
"identity",
"messageTeamMembers"
]
}
Code:
ngOnInit(): void {
microsoftTeams.initialize();
microsoftTeams.settings.registerOnSaveHandler((saveEvent) => {
microsoftTeams.settings.setSettings({
entityId: 'Create',
contentUrl: 'https://localdev-test.test.com/connector',
removeUrl: 'https://localdev-test.test.com/connector',
configName: 'Create'
});
microsoftTeams.settings.getSettings((settings) => {
this.webhookUrl = settings.webhookUrl;
localStorage.setItem('connectorWebHook', this.webhookUrl);
});
saveEvent.notifySuccess();
});
}
onClick(): void {
if (!this.webhookUrl) {
microsoftTeams.settings.setValidityState(true);
}
}
This is a Microsoft Bug, the "Configuration page for your Connector" on the Connector Portal is immutable (even though it is in an edit field). Meaning that the URL you set on the creation of the Connector can not change through development or you will get this error. So just making a new connector through the portal with my changed configuration URL fixed my problem.
A comment on their git points to this as well: https://github.com/MicrosoftDocs/msteams-docs/issues/1738#issuecomment-647675420
I am very new to spring boot in pivotal cloud foundry. I am able to deploy the apps and bind them to config-server. When i access the app, it is asking for login details. I tried with pivotal credentials it didn't worked. I am struggling from days to find the credentials for this. Can someone help where can i find the username and password.
I have checked VCAP_SERVICES env variable but no luck. Below is my VCAP_SERVICES
{
"VCAP_SERVICES": {
"p-config-server": [
{
"binding_name": null,
"credentials": {
"access_token_uri": "https://p-spring-cloud-services.uaa.run.pivotal.io/oau
th/token",
"client_id": "p-config-server-066a4553-a934-4d52-b016-30e2ab7e6d90",
"client_secret": "rHnPwJj613pP",
"uri": "https://config-da1be911-4c82-41a3-a3bd-0b06ea295480.cfapps.io"
},
"instance_name": "config-server",
"label": "p-config-server",
"name": "config-server",
"plan": "trial",
"provider": null,
"syslog_drain_url": null,
"tags": [
"configuration",
"spring-cloud"
],
"volume_mounts": []
}
],
"p-service-registry": [
{
"binding_name": null,
"credentials": {
"access_token_uri": "https://p-spring-cloud-services.uaa.run.pivotal.io/oau
th/token",
"client_id": "p-service-registry-ae9f69cf-258d-45ea-821e-1fa4db37f1a3",
"client_secret": "XJOLKHZqwssd",
"uri": "https://eureka-89a144f4-7dc7-4b6d-8152-c4414b748ec0.cfapps.io"
},
"instance_name": "service-registry",
"label": "p-service-registry",
"name": "service-registry",
"plan": "trial",
"provider": null,
"syslog_drain_url": null,
"tags": [
"eureka",
"discovery",
"registry",
"spring-cloud"
],
"volume_mounts": []
}
]
}
}
{
"VCAP_APPLICATION": {
"application_id": "1b398fd8-61f2-47e3-875d-d3fe7574513a",
"application_name": "customer-service",
"application_uris": [
"customer-service-demo.cfapps.io"
],
"application_version": "d0243f11-b7af-4bb3-b3a3-b7a4c95e6298",
"cf_api": "https://api.run.pivotal.io",
"limits": {
"disk": 1024,
"fds": 16384,
"mem": 1024
},
"name": "customer-service",
"organization_id": "8e425cae-75a0-433a-a8a7-79c4f81d7c85",
"organization_name": "MSA_springboot",
"process_id": "1b398fd8-61f2-47e3-875d-d3fe7574513a",
"process_type": "web",
"space_id": "8902b90c-9964-4f9d-b426-ca1635589ebe",
"space_name": "development",
"uris": [
"customer-service-demo.cfapps.io"
],
"users": null,
"version": "d0243f11-b7af-4bb3-b3a3-b7a4c95e6298"
}
}
User-Provided:
SPRING_PROFILES_ACTIVE: dev
No running env variables have been set
No staging env variables have been set```[enter image description here][1]
[1]: https://i.stack.imgur.com/9kNWC.png
I have been trying to host bot which works on local to the Azure Hosting.
I'm trying to connect hosted bot with local emulator gives connection error (emulator :Cannot post activity. Unauthorized).
My .bot file:
{
"name": "production",
"description": "",
"services": [
{
"type": "endpoint",
"appId": "********************",
"appPassword": "*************",
"endpoint": "intermediatorbotsample2019.azurewebsites.net/api/messages",
"name": "AzureAccountLive",
"id": "178"
}
],
"padlock": "",
"version": "2.0",
"path": "D:\\Architecture\IntermediatorBot\\production.bot",
"overrides": null
}
I took a look at your bot file in your comment. The problem is that you have "name": "AzureAccountLive" in your services section. This name MUST be "production". The outer level "name" has to match the name of the bot (in this case, it's probably intermediatorbotsample2019). It's the Name:Production, Type:Endpoint combination that ABS looks for. If you update your botfile to match what I have below, your bot should work as expected.
{
"name": "YOURBOTNAMEHERE",
"description": "",
"services": [
{
"type": "endpoint",
"appId": "********************",
"appPassword": "*************",
"endpoint": "http://intermediatorbotsample2019.azurewebsites.net/api/messages",
"name": "production",
"id": "178"
}
],
"padlock": "",
"version": "2.0",
"path": "D:\\Architecture\IntermediatorBot\\production.bot",
"overrides": null
}
Re genreted AppId and secret from https://dev.botframework.com/.
Previously was using AzureBotProject replaced it with AzureBotChannelProject instead.
I want to run HTTP checks on services registered as External Services with consul.So far the check gets registered but is never called.
What am I missing.
{
"Datacenter": "dc1",
"Node": "new",
"Address": .google.com",
"Service": {
"ID":"re",
"Service": "search2",
"Port": 80
},
"Check":{
"Node":"new",
"CheckID":"Test",
"HTTP":"http://www.google",
"ServiceID":"re"
}
}
You have to specify Interval to check service health.You can do it as follows:
For TCP port check:
{
"check": {
"id": "http",
"name": "http TCP on port 80",
"tcp": "localhost:80",
"interval": "10s",
"timeout": "1s"
}
}
For HTTP api check:
{
"check": {
"id": "api",
"name": "HTTP API on port 5000",
"http": "https://localhost:5000/health",
"tls_skip_verify": false,
"method": "POST",
"header": {"x-foo":["bar", "baz"]},
"interval": "10s",
"timeout": "1s"
}
}