I am working on a Grails based application.
I have configured my application to work with mail and Database setting from
configuration file(app-config.properties file present in the conf folder).
It is working properly.
Config.groovy:
grails<br />
{<br />
mail<br />
{<br />
host = ""<br />
username = ""<br />
password = ""<br />
port = 0<br />
from = "" <br />
props = ["mail.smtp.auth":"true" ]<br />
}<br />
}<br />
**app-config.properties**:<br />
grails.mail.default.from =abc#test.com<br />
grails.mail.host =mail.test.com<br />
grails.mail.username =testUser<br />
grails.mail.password =testPassword<br />
grails.mail.port =25<br />
grails.mail.from = abc#test.com<br />
Some Other Details:
1. Grails Version : 1.3.7
2. Mail Plugin version : 1.0
My requirement is that I want to use encrypted user name and password for mail setting.
My question is that how can I use any encrypted property with mail setting as well as any
other attributes in Grails(i.e. Database user credentials....).
Regards,
Sanjay Kharwar
Already somewhat answered in the 2 following places:
Stackoverflow answer
Grails-3620
I ran across this site while searching: http://grsage.com/new/GrailsPasswordEncyrption.html
It's pretty straight foward.
Related
I have an issues with AAD on localhost.
I have well followed this how-to
The first step was to declare my app in registration and it is working on my azurewebsite.net.
Second step was to declare my https://localhost:443/ and add Autorize attribute with connected services. But in this case, I've got ever a 401.
My web.config is populated with this settings
<add key="ida:ClientId" value="[GUID from App Id]" />
<add key="ida:Tenant" value="[tenant url]" />
<add key="ida:Audience" value="[App Id URI]" />
<add key="ida:Password" value="[hash]" />
<add key="ida:MetadataAddress" value="https://login.microsoftonline.com/[tenant url]/federationmetadata/2007-06/federationmetadata.xml" />
On AppServices > Settings, I've updated this value
HomePage : https://localhost:443/
Reply Url : https://localhost:443/ (tried with https://localhost:443/.auth/login/aad/callback but same 401)
What am I missing ?
Thanks for your helps.
You need to update the application registration in the Azure portal. Find your application, and then go to Settings | Reply URLs, and add the .azurewebsite.net URL
I need to use AdWrods Api v201506 for some simple operations, but i still get authorization error (I will pass it in the bottom of this post). I think the problem is not in the code (I just copy-paste it from googles documentation) but in the account settings, so the best way to find out error is show you what I do in every step.
Create production MCC account here (production-mcc#gmail.com). Notice that I chosen "To manage other people's accounts." as an answer for "How will you primarily use this AdWords manager account?".
Get developer token for production-mcc#gmail.com. It's still "waiting for approve" but it's not a problem because I will use test account.
Create test MCC account here (for To manage other people's accounts., test-mcc#gmail.com).
Create new Project in Console Google Developer as test-mcc#gmail.com (MyProject).
Create app in consent screen (MyProject_App).
Create new Client ID for web application:
JavaScript origins: http://localhost:50194/
Redirect URIs: http://localhost:50194/oauth2callback (autogenerated) and http://localhost:8080/ - without this url I not be able to generate refresh token with OAuthTokenGenerator.exe (from here). Installed application as an "Other" type and generate refresh token with OAuthTokenGenerator.exe (from here).
Go to Google Adwords and add client account (button +Account -> Create New AdWords Account). Save changes and copy his id.
Now get Client ID, Client Secret and successfully generate refresh token.
Install with NuGet Google.AdWords and Google.Ads.Common packages in MVC project.
Edit <AdWordsApi> sections in web.config file as below:
<!-- Settings related to SOAP logging. -->
<add key="MaskCredentials" value="true" />
<!-- Settings related to general library behaviour. -->
<!-- Use this key to automatically retry a call that failed due to a
recoverable error like expired credentials. -->
<!-- <add key="RetryCount" value="1"/> -->
<!-- Set the service timeout in milliseconds. -->
<!-- <add key="Timeout" value="100000"/> -->
<!-- Use this key to enable or disable gzip compression in SOAP requests.-->
<add key="EnableGzipCompression" value="true" />
<!-- Proxy settings for library. -->
<add key="ProxyServer" value="" />
<add key="ProxyUser" value="" />
<add key="ProxyPassword" value="" />
<add key="ProxyDomain" value="" />
<!-- Settings specific to AdWords API.-->
<add key="UserAgent" value="RANDOM_STRING" />
<add key="DeveloperToken" value="DEV_TOKEN_FROM_2_PARAGRAPH" />
<!-- If your application is a simple script that makes calls to only a
single Adwords account, then you can set your customer ID here. If you
have multiple customer IDs to deal with in your account, then you can
comment out this key and set the value at runtime by setting
((AdWordsAppConfig) user.Config).ClientCustomerId = "xxx";
-->
<add key="ClientCustomerId" value="CLIENT_ID_FROM_7_PARAGRAPH" />
<!-- Use the following settings to skip the report header and summary rows
when downloading a report in CSV, TSV or their gzipped formats. -->
<add key="SkipReportHeader" value="false" />
<add key="SkipReportSummary" value="false" />
<add key="SkipColumnHeader" value="false" />
<!-- Use the following setting to include zero impression rows when
downloading a report. If this setting is commented out, then the server
behaves as explained in
https://developers.google.com/adwords/api/docs/guides/zero-impression-reports#default_behavior.
-->
<!-- <add key="IncludeZeroImpressions" value="true"/> -->
<!-- Settings specific to use OAuth2 as authentication mechanism. You could
run Common\Util\OAuth2TokenGenerator.cs to generate this section of the
config file.
-->
<!-- Provide the OAuth2 client ID and secret. You can create one from
https://console.developers.google.com. See
https://github.com/googleads/googleads-dotnet-lib/wiki/Using-OAuth2
for more details.
-->
<add key="OAuth2ClientId" value="CLIENT_ID_FROM_8_PARAGRAPH" />
<add key="OAuth2ClientSecret" value="CLIENT_SECRET_FROM_8_PARAGRAPH" />
<!-- The following OAuth2 settings are optional. -->
<!-- Provide a different OAuth2 scope if required. Multiple scopes should be
separated by spaces. -->
<!-- <add key="OAuth2Scope" value="INSERT_OAUTH2_SCOPE_HERE" /> -->
<!-- Use the following keys if you want to use Web / Installed application
OAuth flow.-->
<add key="OAuth2Mode" value="APPLICATION" />
<!-- If you are using a single MCC account's credentials to make calls to
all your accounts, then you can run OAuth2TokenGenerator.cs to generate
a RefreshToken for that account and set this key in your application's
App.config / Web.config. If you are making calls to multiple unrelated
accounts, then you need to implement OAuth2 flow in your account and
set this key at runtime. See OAuth folder under Examples folder for a
web and a console application example.
-->
<add key="OAuth2RefreshToken" value="REFRESH_TOKEN_FROM_8_PARAGARAPH" />
<!-- Optional: Specify an OAuth2 redirect url if you are building a
web application and implementing OAuth2 web flow in your application.
-->
<!-- <add key="OAuth2RedirectUri" value="" /> -->
<!-- Use the following keys if you want to use OAuth2 service account flow.
You should comment out all the keys for Web / Installed application
OAuth flow above. See
https://developers.google.com/adwords/api/docs/guides/service-accounts
https://github.com/googleads/googleads-dotnet-lib/wiki/Using-OAuth2
for more details.
-->
<!--
<add key="OAuth2Mode" value="SERVICE_ACCOUNT" />
<add key="OAuth2ServiceAccountEmail"
value="INSERT_OAUTH2_SERVICE_ACCOUNT_EMAIL_HERE" />
<add key="OAuth2PrnEmail" value="INSERT_OAUTH2_USER_EMAIL_HERE" />
<add key="OAuth2JwtCertificatePath"
value="INSERT_OAUTH2_JWT_CERTIFICATE_PATH_HERE" />
<add key="OAuth2JwtCertificatePassword"
value="INSERT_OAUTH2_JWT_CERTIFICATE_PASSWORD_HERE" />
-->
Now, I just copy-paste code from example in Google Developers Documentation.
After running I got exception in:
BudgetReturnValue budgetRetval = budgetService.mutate(
new BudgetOperation[] {budgetOperation});
and it call: [AuthorizationError.USER_PERMISSION_DENIED # ; trigger:'<null>']
According to documentation it means: "User doesn't have permission to access customer.".
My question is: what I'm doing wrong with authorization? Which token or id is invalid?
PS. I described all steps which I done - not less not more.
I found solution for exception ([AuthorizationError.USER_PERMISSION_DENIED # ; trigger:'<null>'] ): the problem was in refresh token - when I generated his I was loggin in my private account not as a test-mcc#gmail.com. So when you will use OAuthTokenGenerator.exe make sure that you sigin in proper account when generator shows new window and ask for permission.
Using VS 2013 Cordova Tools (the current version), my iOS app does not display the given splashscreen and icons unless I set <icon> and <splashscreen> elements in config.xml. However, when config.xml is edited using the visual editor, it simply deletes all <icon> and <splashscreen> elements. Am I missing something?
Obs: icons and splash screen works for android apps out of the box, it just does not work for iOS.
Unfortunately this is a known issue when using the latest version of vs-mda-remote with VS 2013.
You should be able to add this XML to config.xml via Right-Click > View Code to resolve the issue.
<platformname="ios">
<iconsrc="res/icons/ios/icon-60-3x.png"width="180"height="180" />
<iconsrc="res/icons/ios/icon-60.png"width="60"height="60" />
<iconsrc="res/icons/ios/icon-60-2x.png"width="120"height="120" />
<iconsrc="res/icons/ios/icon-76.png"width="76"height="76" />
<iconsrc="res/icons/ios/icon-76-2x.png"width="152"height="152" />
<iconsrc="res/icons/ios/icon-40.png"width="40"height="40" />
<iconsrc="res/icons/ios/icon-40-2x.png"width="80"height="80" />
<iconsrc="res/icons/ios/icon-57.png"width="57"height="57" />
<iconsrc="res/icons/ios/icon-57-2x.png"width="114"height="114" />
<iconsrc="res/icons/ios/icon-72.png"width="72"height="72" />
<iconsrc="res/icons/ios/icon-72-2x.png"width="144"height="144" />
<iconsrc="res/icons/ios/icon-small.png"width="29"height="29" />
<iconsrc="res/icons/ios/icon-small-2x.png"width="58"height="58" />
<iconsrc="res/icons/ios/icon-50.png"width="50"height="50" />
<iconsrc="res/icons/ios/icon-50-2x.png"width="100"height="100" />
</platform>
<platformname="ios">
<splashsrc="res/screens/ios/screen-iphone-portrait.png"width="320"height="480" />
<splashsrc="res/screens/ios/screen-iphone-portrait-2x.png"width="640"height="960" />
<splashsrc="res/screens/ios/screen-ipad-portrait.png"width="768"height="1024" />
<splashsrc="res/screens/ios/screen-ipad-portrait-2x.png"width="1536"height="2048" />
<splashsrc="res/screens/ios/screen-ipad-landscape.png"width="1024"height="768" />
<splashsrc="res/screens/ios/screen-ipad-landscape-2x.png"width="2048"height="1536" />
<splashsrc="res/screens/ios/screen-iphone-568h-2x.png"width="640"height="1136" />
<splashsrc="res/screens/ios/screen-iphone-portrait-667h.png"width="750"height="1334" />
<splashsrc="res/screens/ios/screen-iphone-portrait-736h.png"width="1242"height="2208" />
<splashsrc="res/screens/ios/screen-iphone-landscape-736h.png"width="2208"height="1242" />
</platform>
More known issues: https://www.visualstudio.com/explore/cordova-known-issues-vs
I had similar problem. I simply didn't use graphical config editor and use only text one.
However, the Visual Studio 2015 RC fixes this problem and there is an implicit configuration for every icon and splash screen.
I am using WIF SSO for authentication in my website. Everything works perfect in development environment. But on deployment I got issue
Message: The data protection operation was unsuccessful. This may have
been caused by not having the user profile loaded for the current
thread's user context, which may be the case when the thread is
impersonating. ExceptionStackTrace: at
System.Security.Cryptography.ProtectedData.Protect(Byte[] userData,
Byte[] optionalEntropy, DataProtectionScope scope) at
Microsoft.IdentityModel.Web.ProtectedDataCookieTransform.Encode(Byte[]
value)
Searching abt this issue leads me to this stackoverflow question
Is it possible to run WIF without LoadUserProfile = True
I added the code mentioned but now I am getting
Value cannot be null
I am getting e.ServiceConfiguration.ServiceCertificate ServiceCertificate null. My question is what kind of certificate is this and where can I define this in my config. Do I need to place the same certificate on ACS.
here is my config section
<microsoft.identityModel>
<service>
<audienceUris>
<add value="http://localhost:9494/" />
</audienceUris>
<federatedAuthentication>
<wsFederation passiveRedirectEnabled="true" issuer="https://devworks-sb.accesscontrol.appfabriclabs.com/v2/wsfederation" realm="http://localhost:9494" requireHttps="false" />
<cookieHandler requireSsl="false" />
</federatedAuthentication>
<applicationService>
<claimTypeRequired>
<!--Following are the claims offered by STS 'https://devworks-sb.accesscontrol.appfabriclabs.com/'. Add or uncomment claims that you require by your application and then update the federation metadata of this application.-->
<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name" optional="true" />
<claimType type="http://schemas.microsoft.com/ws/2008/06/identity/claims/role" optional="true" />
<!--<claimType type="http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier" optional="true" />-->
<!--<claimType type="http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider" optional="true" />-->
</claimTypeRequired>
</applicationService>
<issuerNameRegistry type="Microsoft.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
<trustedIssuers>
<add thumbprint="BE9D0A516BEC2BC820C23D5C2EA79F068C094382" name="https://devworks-sb.accesscontrol.appfabriclabs.com/" />
</trustedIssuers>
</issuerNameRegistry>
</service> </microsoft.identityModel>
thanx
First thing you mentioned that the problem occurred after deployment, is that right? In your web.config have you changed the audienceUris to http://whatever_service_name.cloudapp.net?
<audienceUris>
<add value="http://localhost:9494/" /> <== This is wrong
</audienceUris>
Next your question about certificate is NULL at e.ServiceConfiguration.ServiceCertificate, please verify the following:
A. Endpoint is added in your application Service Definition:
B. Certificate thumbprint is set in Service Configuration
C. Certificate is set in web.config which is correct above
D. Finally added the following in your web.config so certificate can be search by thumbprint:
<serviceCertificate>
<certificateReference x509FindType="FindByThumbprint" findValue="CERT_THUMB" />
</serviceCertificate>
Study these two resources which will be very helpful:
http://www.jimandkatrin.com/CodeBlog/post/Troubleshooting-Azure-issues.aspx
http://blogs.msmvps.com/marcelmeijer/blog/2012/05/04/windows-azure-wif-access-control-acs/
The root cause is likely to be you’re using DPAPI (the default configuration of WIF). Please try to do a few modifications for the application to work in Windows Azure. I would like to suggest you to check http://msdn.microsoft.com/en-us/IdentityTrainingCourse_WIFonWAZLab2010 for a tutorial.
Best Regards,
Ming Xu.
I have an XML file with a lot of nodes similar to the following format:
<Factsheet page="GenericOfflineFactsheet.aspx" pageTitle="MyTitle" >
<TopStrapline text="BlahBlahBlah" />
<Commentary page="Text.ascx" />
<ChartPanel page="Bar.ascx" appearanceFile="Bar.xml" />
<Strapline text="blah blah blah" />
<Funds>
<fund id="215" countryid="N0" />
<fund id="561" countryid="N0" />
</Funds>
<LegalText effectiveDate="08 June 2010">
<Line id="30321" />
<Line id="10301" />
</LegalText>
</Factsheet>
Is there any free plugins (or any other means) out there that I could use in an ASP.NET MVC application to generate a basic UI for editing this kind of file?
What about LinqToXML? Then you can use this as your model in your controllers and views just like LinqToSQL.
LinqToXML