How to include email in SAML2 response in OKTA - okta

I have never used OKTA before. I have setup an APP in OKTA to test SAML authentication. Created users in Directory. My client web application is able to login using OKTA authentication with SAML 2. However, my client web application is also expecting email in SAML2 response. How do i include email in Response from OKTA?. Currently in SAML 2 response i only see saml2:NameID
Steps i followed
1>Login to OKTA dashboard as admin
2>Goto Directory -> Profile Editor -> Select My App -> profile
2>Add new Attribute as below
3> after saving attribute, click on Mappings
4> Select Okta User to My App tab and set the mapping as below
ISSUE
After successful authentication, the response SAML 2 from OKTA does not include email attribute. The only attribute i see is NameID

When you create a new SAML integration, or modify an existing one, you can define custom attribute statements. These statements are inserted into the SAML assertions shared with your app.
In the Admin Console, go to Directory > Profile Editor, and find the
integration you just created. Click Profile.
In the Attributes screen that opens, click Add Attribute.
Add a new attribute and click Save
In the Admin Console, go to Applications > Application and click the
app name.
In the screen that opens, click the General tab. Then click Edit in
the SAML Settings section.
In the screen that opens, click Next.
In the Attribute Statements (Optional) section, type in the name of
the attribute you just created in step 3. This value does not
populate the drop-down box automatically. For the Value, type
"appuser", a period, and the attribute name. For example, if your
attribute is named NewRole, the Value is appuser.NewRole.
When done, click Next.
On the Applications page, click the integration name, then click the
Assignments tab. Click Assign, and select Assign to Groups. In the
window, click Assign to the right of the group. You can verify these
assignments with a SAML tracer.
More details here:
https://support.okta.com/help/s/article/How-to-define-and-configure-a-custom-SAML-attribute-statement?language=en_US

Related

I can't enable MFA for Oracle Identity Cloud Service user

I just sign-up an account of Oracle Cloud
After I logged in, It seem the system automatically created a tenancy for me and added me to an Identity Providers named oracleidentitycloudservice.
They also create one more user starts with oracleidentitycloudservice/username.
This is identity user page, both 2 of them is me. One of them is federated with oracleidentitycloudservice which is created automatically.
I can enable MFA for the second account.
But I can not enable MFA account for oracleidentitycloudservice/username:
When I want to login to Identity Console page, I need to use this SSO method:
It seem risky if Identity Console page doesn't provide MFA feature. That's what I worry about.
Question is:
Is it safe if I delete oracleidentitycloudservice/username?
How can I enable MFA for oracleidentitycloudservice/username from Oracle Infastructure page?
If Oracle is providing a complicated way to enable MFA for oracleidentitycloudservice/username, could it be a security issue?
For those who are in the same situation, here is step to Enable MFA for Oracle Identity cloud service user:
Sign in by this SSO method at this screen:
Go to Service User Console on top-right screen
Go to Admin Console of Identity
Go to My profile on top-right screen
Go to Security tab, our goal is to give the account permissions so that MFA item shows on this screen. At this moment MFA is not yet enabled, move to next step
Go to Admin console at top-right screen
Go to Security -> MFA at left side panel, check the box Mobile App Passcode
Go to Security -> Sign-On Policies, edit the Default Policy
Edit Default Sign-on Rule
Select the option that you prefer. It's upto you.
Go to Security tab and here you can enable MFA for your IDCS account
Sign-out and Sign-in again. Now you can use MFA to login.
Here's how you enable MFA (TOTP Authenticator) for Free Tier accounts:
Navigate to https://www.oracle.com/in/cloud/sign-in.html
Enter your Cloud Account Name and click Next
Select oracleidentitycloudservice as your Identity Provider and click Continue
Enter your username and password
Click on hamburger menu and select Identity & Security > Federation
Click on OracleIdentityCloudService
Click on the link next to Oracle Identity Cloud Service Console
You should be logged into the Oracle Identity Cloud Service console. Click on the hamburger menu and select Security > MFA
I don't see a way to enable Duo Security or FIDO Authenticator at this screen. Probably because the license type is Foundation but if you found a way to enable either of those, please edit this answer. If not, enable Mobile App Passcode and Mobile App Notification and click Save
Click on the top right corner of the screen with your initials and select My Profile
Click on the Security tab and you should see a 2-Step Verification section with an Enable button.
Click on Enable and select Mobile App
Check Offline Mode or Use Another Autenticator App
Scan the QR code with your favorite TOTP app (I used Authy) and enter a code and click Verify
You'll now have a 2SV factor enabled
Go back to the console by clicking on your initials at the top right corner and selecting Admin Console
Click on the hamburger menu and navigate to Security > Sign-On Policies
Edit the Default Sign-On Policy by clicking on and selecting Edit
Click on the Sign-On Rules tab and edit the Default Sign-On Rule by clicking on and selecting Edit
Scroll down to Actions section and enable Prompt for an additional factor and leave the rest at defaults and click Save
Log out and log back in again (alternatively open the Oracle Identity Cloud Service Console URL from step 7 in a private/incognito tab) and verify that you're prompted for the TOTP code after entering your username and password.
This is already old information, OCI is constantly changing it's dashboard. If you can't find the correct screens anymore, see this Oracle Documentation page, with which I set the policy after I enabled 2FA on my profile via Security:
https://docs.oracle.com/en-us/iaas/Content/Identity/mfa/understand-multi-factor-authentication.htm?Highlight=mfa
After that 2FA is asked after you login with your credentials.
I have the same issue.
I was following an official training from Oracle and found that the option did not appear because I was using the federated user.
You may manage all the users from the the lines button at the top-left corner and from there 'Identity & Security'.
First menu Identity & Security
Once you click on that option, you will see:
Choose Users
And this is the main user's options with the MFA and password reset if required:
User's options including MFA
Dani.

Okta not returning custom claims in tokens

I just signed up for a dev test account with Okta to test OIDC using Okta's auth service and user management.
Using their management portal, I created a second group called Test Group along with the default group of Everyone and added my single user to both groups.
I then added an application called My SPA and assigned the Test Group access to this application.
Using the classic UI, I then edited the OpenID Connect ID Token section and set Group claims type to Expression and added groups as the claim name and getFilteredGroups(app.profile.groupwhitelist, "group.name", 40) as the expression.
I then went and edited the authorization server. I added a claim called 'groups' with a RegEx of *. to be used with any scope, access tokens and always include.
I then use the Token Preview selecting my user and using implicit grant flow but no groups show up.
How do you get a user's groups to show up as claims in the ID or Access Token from an Okta auth server?
Edit
Screen shots of what I have:
I’ve only ever used the Developer Console to configure things. Here’s how I did it:
Navigate to API > Authorization Servers, click the Authorization Servers tab and edit the default one. Click the Claims tab and Add Claim. Name it "groups" or "roles", and include it in the ID Token. Set the value type to "Groups" and set the filter to be a Regex of .*.
You need to add the "groups" scope. In the scope, add "groups" in addition to profile and openid
I think the Groups here are created in order to park users in respective buckets (e.g. Admins / Users etc) so that by knowing the Group of User, the role can be derived for Authorizations.
However, I will recommend to use Okta's Custom Attribute in Users' Profile so that the User Info can have required attribute.
The Custom Attribute can be set as Dropdown styled Enumeration to choose from and can also be marked as Mandatory while adding User in system.
https://support.okta.com/help/s/article/How-to-create-dropdown-enumerated-custom-attributes-in-Okta?language=en_US
Adding Custom Attribute - https://help.okta.com/en/prod/Content/Topics/users-groups-profiles/usgp-add-custom-user-attributes.htm
And Mapping Attributes to Okta Profile -
https://help.okta.com/en/prod/Content/Topics/users-groups-profiles/usgp-about-attribute-mappings.htm
Hope this also helps.

How do I show visitor count in my page using google analytics?

How do I show visitor count on my home page using google analytics?
I want this in my Jersey web application.
Thanks.
Go to https://code.google.com/apis/console
Click 'Create Project'
Create a credentials - OAuth 2.0 Client ID
Select Application Type: Web application.
Under IAM & ADMIN, select 'Service Account' and create Service
Account.
Select role to project -> owner.
Check 'Furnish a new private key' and select P12.(it will download this file).
Copy this service account id.
Log in to your Google Analytics account
Click 'Admin' in the bottom-left corner
Click the 'User Management' tab
paste this service account id in add permission field and click Add
button.
Set up the sample https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-java
Set the service account and path to the p12 file.
Run the Program.

Setting Azure API access permissions not recognizing other API's

I followed this tutorial to create a aspnet core web api using Azure for a test project I'm working on:
https://github.com/Azure-Samples/active-directory-dotnet-webapp-webapi-openidconnect-aspnetcore
The instructions says "Configure Permissions for your application - in the Settings menu, choose the 'Required permissions' section, click on Add, then Select an API, and type 'TodoListService' in the textbox. Then, click on Select Permissions and select 'Access TodoListService'"
I followed every step closely and most was on target with everything, but this step didn't show my todolist service.Below is the screenshots in the order I did them.
Navigate to the apps page
Go to settings and required permissions for either app
Click add at the top left hand corner to add a new permission
To Do List Service and To Do List Web App are not listed
The tutorial worked for the most part. I am able to run the VS solution and sign in to an azure account associated with my application. However the users don't have read permissions to the to do list on the website, and I think it is because I had to skip this step.
After logging in through MS
Shows logged in
User cant view the to do list
As you can see I am clearly logged in, but am not able to see the list

How to get oauthConsumerkey and oauthConsumerSecret of google app?

I am trying to create a connector for Google spreadsheet. So that I try to create an app in Google developer console, After that how can I get oauthConsumerkey and oauthConsumerSecret from it? Are there any links or guidance to explain it? videos or websites? I have refer some Google sites, But I'm unable to get clear information from it.
On The developer console (https://console.developers.google.com), click on Create Project.
Click on APIs & auth on the left hand side menu to enable APIs (this isn't required for spreadsheets)
A new button should appear in the left hand side menu 'Credentials'
Click on Create new Client ID
This will provide you with the ClientID, Client Secret and Email Address. Set Redirect URIs and Javascript Origins as required by your application.
You will also need an API key, which is generated by clicking on the 'Create new Key' button beneath the OAuth section.
In order to allow users to login from your application, you can use http://www.accountchooser.com. Which is farely easy to use and allows for various identities.

Resources