Have a look at Core.initializeSession on how to create a Session. If you do not have an IUser object yet you can fetch one using the Core.getUser Method.
If you check out the OAuth module, the relevant code can be found in:
/javasource/oauthmodule/actions/custom/LoginHelper.java
which is called from around
/javasource/oauthmodule/actions/custom/OauthCallback.java line 281
Be aware that you should set cookie information (see LoginHelper.java) and that you can only do that in a request handler.