how to generate SAML metadata file - active-directory

SAML metadata is used to share configuration information between the Identity Provider (IdP) and the Service Provider (SP). Metadata for the IdP and the SP is defined in XML files:
The IdP metadata XML file contains the IdP certificate, the entity ID, the redirect URL, and the logout URL, for example, saml_idp_metadata.xml.
The SP metadata XML file contains the SP certificate, the entity ID, the Assertion Consumer Service URL (ACS URL), and a log out URL (SingleLogoutService), for example, saml_sp_metadata.xml.
Before using SAML to log on to the Web Console, metadata from the IdP must be uploaded and metadata from the SP must be generated. After the SP metadata is generated, it must be shared with the IdP. Contact the IdP for instructions on securely sharing the SP metadata.

Download Windows Identity Foundation SDK, below url
https://www.microsoft.com/en-us/download/details.aspx?id=4451
After install run fedutil.exe from sdk
After open federation utility Create one empty web.config file with following content
Now paste the web config path in “Application configuration location”.
Paste application url under section Application URL, click next
Select Use an Existing STS, click next
Put metadata xml url , which is provided by client.
Click next., select no encryption.
Click next to add claims
Click next then you will get the summery.
Click finish., find location of web.config file, at that location one folder is created names as “FederationMetadata”
Open this folder “FederationMetadata”, inside this one folder is exists, inside this folder one file is exists named as “FederationMetadata.xml”.
This is your final xml file.
Take a sample userid, password from adfs/server team, to test your application.
Then after open metadata xml and provide claims to adfs teams like
Group
Department
Mail
EmailAddesss
Given Name
Name
Name ID
Windows account name
Once get confirmation from Adfs team (he will create trust on his server using our xml file). We can test our application using shared user credentials.

Related

Active Directory medata xml file. How to get it?

I am trying to setup SSO for PSM application as per this link - https://www.ibm.com/support/knowledgecenter/en/SSL5ES_2.3.2.0/intel/iwd/aat_sec_sso.html
It says I should - upload the IdP metadata XML file received from the Identity Provider.
The Identity provider available in-house is Active Directory.
How to get the metadata XML for Active Directory ?
I am unable to find it .
Thanks,
ADFS does not provide SAML IdP meta data alone, but Federation meta data. Typically you can get it from https://FQDN_OF_THE_ADFS_SERVER/FederationMetadata/2007-06/FederationMetadata.xml
Then you need to extract the SAML IdP meta data from it. Alternatively you may reach out to the ADFS admnistrator and request it. Judging from my experience, you mostly also get the Federation meta data, instead of the SAML one.

Is there something special I need to do to ensure the AAD Connect synchronized extension attribute is included in the token claims?

I have a query about adding extension claims to an idToken using MSAL.JS 1.1.3 – it seems to work where an extension attribute was added into an AAD application but not via AAD Connect.
Is there something I need to do to ensure the AAD Connect synchronized extension attribute is included in the token?
I have the following setup with 2 extension attributes (extension_{id}customOptionalclaimApplicationUserCode (added in AAD) and extension{id}_stuExtensionAttriibute1 (added to AAD via AAD Connect from on-prem AD):
PowerShell displaying attributes
Customer wants to use manifest so I set this up.
The decoded token only includes extn.CustomOptionalClaimApplicationUserCode as per this image
The customer prefers to use manifest optional claims as per the example for least privilege per application instead of claims mapping policy.
To repeat the question: Is there something special I need to do to ensure the AAD Connect synchronized extension attribute is included in the token claims?
From your screenshot, extension_{id}_customOptionalclaimApplicationUserCode 's id is different from extension_{id}_stuExtensionAttriibute1's id.
One of the two ids is the id of the app itself. The other one is the app id used by AD Connect.
Now, the fact is that, from the API , one extension attribute is lying on an application.
However, you can only get the extension claim value from its application in a token. In other words, the resource id should be the same as the id in the extension, then you can get the extension value. For more details, you may refer to: Configuring optional claims
So, the result you got is expected. The extension synced from on premise will not be included in token.

SAML2 Authentication extension for CKAN

Can someone explain Saml2 authentication process? I have installed ckanext-saml2 extension for ckan.I have a extra button in login form which is called login with sso.But I donot have any sp metadata(sp.xml).Also I have idp.xml but what should I write to the this file.Do you have any idea about these files?Should I create a sp.xml file?Also should I change idp.xml file?When I click the button where should I read user information ?
You shouldn't change the idp.xml.
Basically ckanext-saml2 is used to allow Users to enter CKAN portal from other places, rather than only CKAN.
In order to do that, you'll need an idp.xml and sp.xml files.
idp.xml - file that consists of a unique path to the remote Portal where all Users already exists (usually it marked as entityID) and X509 Certificate.
sp.xml - file that is generated by CKAN portal and has pretty much same data as the idp.xml.
Both of those files are used to allow Users to log in into CKAN from other portals. In other words, sp.xml file is provided to the IdP (Identity Provider) and the idp.xml file is provided to the CKAN portal (Service Provider) that is going to use it.
According to the ckanext-saml2 documentation, all configuration should be done in ckanext/saml2/config/sp_config.py file. Configuration should consist entityID URL from idp.xml, path to the idp.xml file, path to logs, data about the CKAN portal, fields that should be taken from the response, their mapping and so on...
After the configuration done, according to documentation, you will be able to generate the sp.xml from the sp_config.py file by using python make_metadata.py sp_config.py.
The button on the login page should redirect you to the IdP login page, where you should log in and be redirected back to CKAN. CKAN will automatically create a User for you if it not exists on the CKAN Portal using the response from the IdP.
For more details, you can check out the Datashades SAML2 CKAN repo or at the original once.
if you are not sure about SSO then you need to have a good reading about that.
Can you tell us what kind of IdP you integrate with? AD FS?
Your sp.xml should be generated by the ckanext-saml2 extension, have a look their git hub page. Then you need to upload sp.xml (sp metadata to your IdP)

The authenticated user has not granted the app xxx write access to the child file xxx, which would be affected by the operation on the parent

I hit the below error when trying to insert the permission
"code": 403,
"message": "The authenticated user has not granted the app xxx write access to the child file xxx, which would be affected by the operation on the parent"
Here is what I am doing
We have two Google Account,
1. API Account - we used to create folder and change the ownership to Business account
2. Business Account - upload a file
now we try to share to folder to customer and we hit the above error
And here I using OAuth 2.0 Installed Applications to get the access token.
Please advise what is wrong I am doing here
I had the same issue but I realize that its because of the scope for credential wasn't setup properly. I only had DriveScopes.DRIVE_METADATA set which was not enough for downloading files. Once I added DriveScopes.DRIVE_FILE, DriveScopes.DRIVE, and DriveScopes.DRIVE_APPDATA, I was able to download the file without any problem. Hope this helps.
P.S. if you are changing credentials, you have to delete the previously saved credential file.
Based on the Official Google Documentation you received '403: The user has not granted the app' because the request is not on the ACL for the file. The user never explicitly opened the file with this Drive app.
It is highly recommended to use Google Open Picker and prompt the user to open the file or direct the user to Drive to open the file with the app.

Upload to S3 without local keys?

What is the best way to upload from AngularJS to S3 without passing the access key or secret down to the client? I have a friend who is trying to accomplish this by creating a pre-signed URL on the server (NodeJS & Express) and then sending the URL to the client for upload. He's claiming it's failing due to CORS but he CAN upload using the sdk from the same AngularJS app & browser.
Update for Clarity
The tricky part is they cannot store anything in an environment variable AND each bucket has different credentials. They're storing info on 10-20 buckets / regions / IAM users and need the end user to select the bucket BY NAME on the client. This means they cannot store anything globally. The server must be able to generate something for the client to use per each request.
His original question:
Generate S3 Put URL Per Request
You can do that by using an IAM Instance Profile for your ec2 server. That way you don't have to provide your access & secret key, because any call done via the AWS SDK will be authenticated via the instance profile permissions. Either of this, in order! authenticate aws api calls:
In system environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.
In the Java system properties: aws.accessKeyId and aws.secretKey.
In the default credentials file (the location of this file
varies by platform).
In the instance profile credentials, which exist within the instance metadata associated with the IAM role for the EC2 instance.
Note the instance profile creds are checked last!
More info here

Resources